Hi,
Hi Pradeep,
Thanks
for using our API’s.<o:p></o:p>
I have tested the scenario using Aspose.Pdf for .NET 9.7.0 where I have used following code snippet and I am able to notice that page dimensions are incorrectly being set. For the sake of correction, I have logged it in our issue tracking system as PDFNEWNET-37747. We will investigate this issue in details and will keep you updated on the status of a correction.
For your reference, I have also attached the resultant PDF generated over my end. However I have observed that the output which you have shared is different from my resultant document so it appears that you are using different code snippet. Can you please share the code snippet which you are using, so that we can again test the scenario. We apologize for your inconvenience.
Here is my code snippet:
Aspose.Pdf.Facades.PdfPageEditor editor = new Aspose.Pdf.Facades.PdfPageEditor();
// bind source PDF file
editor.BindPdf(pdfDocument);
Aspose.Pdf.PageCollection pageCollection = pdfDocument.Pages;
editor.Zoom = 1f;
double height = 0;
double width = 0;
for (int i = 1; i <= pageCollection.Count; i++)
{
if (editor.GetPageSize(i).Height > height)
height = editor.GetPageSize(i).Height;
if (editor.GetPageSize(i).Width > width)
width = editor.GetPageSize(i).Width;
}
if (height > (double)E_LetterSize.Height)
{
editor.Zoom = (float)E_LetterSize.Height / (float)height;
}
else if (width > (double)E_LetterSize.Width)
{
editor.Zoom = (float)E_LetterSize.Width / (float)width;
}
editor.HorizontalAlignment = Aspose.Pdf.HorizontalAlignment.Center;
editor.VerticalAlignmentType = Aspose.Pdf.VerticalAlignment.Center;
editor.PageSize = new Aspose.Pdf.PageSize((float)E_LetterSize.Width, (float)E_LetterSize.Height);
Hi Pradeep,
notice the same problem. For the sake of correction, I have logged this problem
as PDFNEWNET-37773 in our issue tracking system. We will further
look into the details of this problem and will keep you updated on the status
of correction. Please be patient and spare us little time. We are sorry for
this inconvenience.
Hi,