Hello,
Im trying to import some pdf document pages into a pdf document that I am creating on the fly. The original pdf file is a non-standard size and although I can compile the below snippet of code the PDF never imports the pages. I get 2 white pages in my resultant document.
If i use the overload such as ceTe.DynamicPDF.Page(PageSize.Letter, PageOrientation.Portrait, 0 ) the imports work fine but in this case they will crop the original content.
I have tried setting the page dimensions as well but to no avail. Please advise and thanks in advance for any response.
--- Snippet Code Below --
string sImportPath = Server.MapPath(Request.ApplicationPath) + @"mydirectory\directmailer.pdf";
ceTe.DynamicPDF.Document document = new ceTe.DynamicPDF.Document();
ceTe.DynamicPDF.Page page_1 = new ceTe.DynamicPDF.Page(11.25f, 6.5f, 0 );
page_1.Elements.Add( new ImportedPageArea(sImportPath, 1, 0, 0 ));
document.Pages.Add( page_1 );
ceTe.DynamicPDF.Page page_2 = new ceTe.DynamicPDF.Page(11.25f, 6.5f, 0 );
page_2.Elements.Add( new ImportedPageArea(sImportPath, 2, 0, 0 ) );
document.Pages.Add( page_2 );
Importing Non-Standard Size PDF pages
Re: Importing Non-Standard Size PDF pages
Support · Apr 22, 2008I think the issue that you are running into is that you are specifying the Page's dimensions in (what seems to be) inches when in reality the Page constructor is expecting points. There are 72 points per inch so in order to make the conversion just multiply your inches by 72. Try changing your Page constructor from this:
ceTe.DynamicPDF.Page page_1 = new ceTe.DynamicPDF.Page(11.25f, 6.5f, 0 );
To this:
ceTe.DynamicPDF.Page page_1 = new ceTe.DynamicPDF.Page(810, 468, 0 );
Let us know if that resolves this for you.
Thanks,
ceTe Software Support Team
Re: Importing Non-Standard Size PDF pages
Forum member · Apr 22, 2008Thanks,
Thats was the issue but the compiling problem I was having originally was a conversion from double to float....thus the "f". That allowed me to compile but never did do the import.
your support is awesome and timely.
thanks.