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)
file2.Close()
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.
Thanks
New PDF with large page dimensions
Re: New PDF with large page dimensions
Hello,
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();
//http://www.amyuni.com/WebHelp/Amyuni_PD ... Method.htm
//Change page dimensions
pFormat.Length = 16300;
pFormat.Width = 23070;
}
Thanks
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();
//http://www.amyuni.com/WebHelp/Amyuni_PD ... Method.htm
//Change page dimensions
pFormat.Length = 16300;
pFormat.Width = 23070;
}
Thanks
Get PDF Suite, the expert .NET developer toolkit for PDF conversion, creation and editing - www.amyuni.com/pdfsuite
-
- Posts: 2
- Joined: Wed May 22 2013
Re: New PDF with large page dimensions
Thanks for your help, this works well.
Re: New PDF with large page dimensions
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).