New PDF with large page dimensions

The PDF Creator .NET Library enables you to create secure PDF documents on the fly and to view, print and process existing PDF documents. If you have any questions about PDF Creator .Net, please post them here.
Post Reply
Posts: 2
Joined: Wed May 22 2013

New PDF with large page dimensions

Post by FionaBoyle » Wed May 22 2013

I am trying to create a new pdf file with non-standard page sizes :
Dim PdfDoc2 As New Amyuni.PDFCreator.IacDocument(Nothing)
Dim oPage = PdfDoc2.GetPage(1)
oPage.AttributeByName("PaperSize").Value = 256
oPage.AttributeByName("Length").Value = 23070
oPage.AttributeByName("Width").Value = 16300
Dim file2 As New System.IO.FileStream("test.pdf", FileMode.Create, FileAccess.Write, FileShare.Read)
PdfDoc2.Save(file2, Amyuni.PDFCreator.IacFileSaveOption.acFileSaveView)

This code will only set the length of the new page, but not the width. If I switch the lines to set the sizes, it will then set the page width, but not the length.
Does anyone know what I am missing.

Amyuni Team
Posts: 551
Joined: Tue Oct 01 2002

Re: New PDF with large page dimensions

Post by Jose » Mon May 27 2013


I believe your issue can be resolved by using the IacPageFormat object. The object contains all the paper characteristics for a specific page.

using (Amyuni.PDFCreator.IacDocument doc = new Amyuni.PDFCreator.IacDocument(null))

IacPage page = doc.GetPage(1);

//get page format
Amyuni.PDFCreator.IacPageFormat pFormat = page.GetPageFormat();

// ... Method.htm
//Change page dimensions
pFormat.Length = 16300;
pFormat.Width = 23070;

Get PDF Suite, the expert .NET developer toolkit for PDF conversion, creation and editing -

Posts: 2
Joined: Wed May 22 2013

Re: New PDF with large page dimensions

Post by FionaBoyle » Tue May 28 2013

Thanks for your help, this works well.

Posts: 9
Joined: Wed Dec 19 2012

Re: New PDF with large page dimensions

Post by kensands » Wed Apr 30 2014

I'd add to this it seems necessary to set the page length for every page when processing a pdf with many pages. I opened a 10000 page pdf with a long page length and saved to a new pdf 10 of those pages. When viewed the new pdf started correctly but the last 2 pages it'd set to something like A4 size cropping the top and bottom. No idea why as it looked fine in the original pdf. the solution was to set the length in every page before saving, I stored the length value from page 1 and used that for every page (since I knew all pages were the same size).

Post Reply