Page 1 of 1

How do I insert page number to PDF ?

Posted: Mon Nov 07, 2022 10:50 am
by alvinchan
Is there any method allow me to merge PDF and show page number at the footer ?

Re: How do I insert page number to PDF ?

Posted: Wed Nov 09, 2022 6:02 pm
by Hugo
Hi Alvinchan,

Thank you for your question.

These are 2 separate requests however you can do both with GdPicture.
Here is a simple example demonstrating how to merge 2 PDFs (links ordered by most general case to most precise case):
https://www.gdpicture.com/guides/gdpict ... ring).html
https://www.gdpicture.com/guides/gdpict ... ring).html
https://www.gdpicture.com/guides/gdpict ... files.html

Here are some of the methods which should allow you to show page number at the footer:
https://www.gdpicture.com/guides/gdpict ... Count.html
https://www.gdpicture.com/guides/gdpict ... wText.html
https://www.gdpicture.com/guides/gdpict ... ation.html

The above methods do not all need to be used but these can give you an idea of what we offer and allow you to choose your prefered approach depending on your requirements.

Let me know if you need anything else.

Regards,
Hugo Cudd
Technical Support

Re: How do I insert page number to PDF ?

Posted: Fri Nov 11, 2022 9:51 am
by alvinchan
Dear Hugo

Thank you for your reply. For draw text function ,we need to manually calculate the width and height and draw the page number ,is there any pre build function from Gdpicture which can directly insert the page number ?

Re: How do I insert page number to PDF ?

Posted: Mon Nov 14, 2022 6:08 pm
by Hugo
Alvinchan,

You will need to calculate the height and width to do this yes. It should be very straight forward and should require minimal effort on your end as we have functions to calculate page height and width.
If there were a prebuilt function, we would not know where to put this as some prefer the page number to be in the bottom right of the page, and others scenarios would indicate the page number to be center bottom of the page.
If we were to provide a pre-built function, this would be the same speed as if you were to calculate it on your end as we would essentially be doing this internally instead.

Let me know if you need anything else.

Regards,
Hugo Cudd
Technical Support