Hi There,
We are using DynamicPDF to produce complex dynamic documents comprising mostly of text and images. However, some pages on the document will never change, so we are inserting these "fixed" pages using the AppendPDF command.
i.e. m_objDocument.Appendpdf Server.MapPath("PP7Page.pdf")
This all works smoothly apart from the Template used to add the page number to the bottom of the page.
When the page number appears on a page which has been inserted from another PDF, it is set higher than the page numbers appearing on the dynamically created pages. The pages are all A4, measuring 840 by 595 dots.
Is there anything we can do to ensure the page numbers appear at the same vertical level on all pages?
Thanks,
James.
Template Behaviour When Using AppendPDF
Re: Template Behaviour When Using AppendPDF
Support · Apr 19, 2007Hello James,
Can you please double check that the pages of the static PDF you are using and the dynamically created pages are off same size or not. This might be causing because of different page sizes.
Thanks,
ceTe Software Support Team.
Re: Template Behaviour When Using AppendPDF
Forum member · Apr 19, 2007Thank you for your quick response.
I have checked one of the insert documents in Adobe Acrobat and it measures 8.26 inches by 11.69 inches. At 72 dots per inch, that would make the document 594.72 dots by 841.68 dots. The page numbers are around 1cm lower on the dynamic pages.
It looks as though it may be the margins. When we set these to zero, the dynamic documents rise to the same level as the fixed pdf inserts.
Is there a way to set the margins of the appended pdf pages to match that of the dynamic pages?
This is how we are currently setting the margins of the dynamic pages:-
Set m_objPage = m_objDocument.AddPage()
m_objPage.PageHeight = 840
m_objPage.Pagewidth = 595
m_objPage.MarginTop = 20
m_objPage.MarginLeft = 20
m_objPage.MarginRight = 30
m_objPage.MarginBottom = 50
But there does not appear to be any similar properties to set when using AppendPDF or is there?
Thanks,
James.
Re: Template Behaviour When Using AppendPDF
Support · Apr 19, 2007Hello James,
You will have to loop through all the pages of the document after appending the PDF document and reset the margins for all the pages. This will solve your problem.
Thanks,
ceTe Software Support Team.
Re: Template Behaviour When Using AppendPDF
Forum member · Apr 19, 2007Yes, that did the trick. Thanks very much for your prompt assistance!
Kind Regards,
James.
P.S. Here's the code I used in case anyone else finds themselves with the same problem...
Dim i
For i = 1 to m_objDocument.PageCount
Set m_objPage = m_objDocument.GetPage(i)
m_objPage.MarginTop = 20
m_objPage.MarginLeft = 20
m_objPage.MarginRight = 30
m_objPage.MarginBottom = 50
Next