If I’m using Aspose.Pdf.Kit 2.6.3 and I load a PDF file which does not have standard page size (A4, A3…), but certain specific values for page width/height…
Is it possible to obtain those page width/height values using version 2.6.3?
I haven’t found how to do that, and I know it is possible in version 3.0.0 (using, i.e., PdfPageEditor.GetPageSize(pageNumber).Height),
but version 3.0.0 has some issues about adding text and images, so in some way I’m trapped between these two versions.
For Aspose.Pdf.Kit v 2.6.3 you can use the PageSize property of PdfPageEditor http://www.aspose.com/documentation/file-format-components/aspose.pdf.kit-for-.net-and-java/aspose.pdf.kit.pdfpageeditor.pagesize.html
Please see the following thread for code sample <A href="https://forum.aspose.com/t/129195</A></P> <P>Thanks.</P>
Thanks for your answer,
The code that you mentioned assigns values to the page width/height, but does not retrieves them, so I still have a doubt about this.
I know that with Aspose.Pdf.Kit 3.0.0 you could obtain the height like this:
PdfPageEditor pdfPageEditor = new PdfPageEditor();
height = pdfPageEditor.GetPageSize(1).Height;
… But in version 2.6.3 there is no such PdfPageEditor.GetPageSize() method; instead, there is a PdfPageEditor.PageSize property that unfortunately has no getter
(as I said before, right now I’m “forced” to use 2.6.3 because there are issues with 3.0.0)
Thanks and good work!
Sorry for the confusion. You can use the GetPageHeight (http://www.aspose.com/documentation/file-format-components/aspose.pdf.kit-for-.net-and-java/aspose.pdf.kit.pdffileinfo.getpageheight.html) and GetPageWidth (http://www.aspose.com/documentation/file-format-components/aspose.pdf.kit-for-.net-and-java/aspose.pdf.kit.pdffileinfo.getpagewidth.html) function of PdfFileInfo class to get page hieght and width.
I tried that code before, for example like this:
PdfFileInfo info = new PdfFileInfo(pdfFile);
But it doesn’t work in my tests (with Aspose.Pdf.Kit version 2.6.3) when the PDF does not have standard page size (A4, A3…)
Can you please give us the file with which you are having problems so that we can test it.
I’ve attched the PDF file. It has 2 pages, each one with a different size; both of them are not standard sizes.
Thanks in advance.
I've tested it with the pdf and am not able to reproduce the error. The method PdfFileInfo.GetPageWidth works both in v 2.6.3 and in v 3.0, and the width of the two pages are obtained (515 for page1, 756 for page2).
As for the two issues about PdfFileMend in v 3.0, we are working on them and have fixed one. we will inform you if the other issue will be resolved. Sorry for the inconvenience.
You are right. I had those problems because I had not icluded next code line:
I APOLOGIZE for that.
Sorry for the inconvenience and thanks for the attention.