title: How to Add Page-Number in PDF Document automatically by generating in react native
body: <p>I am trying to solve an issue which is get page number in PDF Document at the bottom in every page.
  In My Coding part, i am using react native for android. I have done creating a table in HTML to generate a PDF inside a .js file.
  somethings like that:</p>
  <pre><code>import { StatusBar } from 'expo-status-bar';
  import { StyleSheet, Text, View, Button, TextInput } from 'react-native';
  import { useState } from 'react';
  import { printToFileAsync } from 'expo-print';
  import { shareAsync } from 'expo-sharing';
  
  export default function App() {
    let [name, setName] = useState(&quot;&quot;);
  
    const html = `
      &lt;html&gt;
        &lt;body&gt;
          &lt;h1&gt;Hi ${name}&lt;/h1&gt;
          &lt;p style=&quot;color: red;&quot;&gt;Hello. Bonjour. Hola.&lt;/p&gt;
        &lt;/body&gt;
      &lt;/html&gt;
    `;
  
    let generatePdf = async () =&gt; {
      const file = await printToFileAsync({
        html: html,
        base64: false
      });
  
      await shareAsync(file.uri);
    };
  
    return (
      &lt;View style={styles.container}&gt;
        &lt;TextInput value={name} placeholder=&quot;Name&quot; style={styles.textInput} onChangeText={(value) =&gt; setName(value)} /&gt;
        &lt;Button title=&quot;Generate PDF&quot; onPress={generatePdf} /&gt;
        &lt;StatusBar style=&quot;auto&quot; /&gt;
      &lt;/View&gt;
    );
  }
  
  const styles = StyleSheet.create({
    container: {
      flex: 1,
      backgroundColor: '#fff',
      alignItems: 'center',
      justifyContent: 'center',
    },
    textInput: {
      alignSelf: &quot;stretch&quot;,
      padding: 8,
      margin: 8
    }
  });
  </code></pre>
  <p>like i want to add page number and imagine i have multiple pages in my PDF documents.
  How can i get the page numbers for each page.
  I already tried lots of things seems nothing is works for me. I'll appreciate if anyone help me to fixed it kindly.
  Thanks for your trying!</p>