Free Support Forum - aspose.com

Issue in converting PDF page Size

Issue:

Issue in converting few .pdfs to Letter size .pdf files.

Details:
The existing code (Aspose 4.0) stopped working after migrating to newer version (7.1) of Aspose.Pdf.
Tested the code with 3 different approaches and still see same issue.

Steps:
1. Open the .pdf file as doc in program and change the page size using Aspose.PDF
2. Save the .pdf file as new .pdf file
3. Few pdf files are showing error "There was an error processing a page. There was a problem reading this document."
e.g. TestA.pdf converted to Conv_TestA_1.pdf - Giving error
e…g TestB.pdf converted to Conv_TestB_1.pdf - Not Giving error
Refer Original&Covertedfile.zip for files

Code Details:
Refer AsposeChangePDFPageSize.zip for code details.
static void Main(string[] args)
{
string folderPath = @“E:\Test”;

SetAsposeLicence(folderPath);

// First (1) Approach
ChangePageSize1(folderPath + “TestA.pdf”, 620, 792, folderPath + “Conv_TestA_1.pdf”);
ChangePageSize1(folderPath + “TestB.pdf”, 620, 792, folderPath + “Conv_TestB_1.pdf”);
Console.WriteLine(“First (1) Approach - Complete”);

// Second (2) Approach
ChangePageSize2(folderPath + “TestA.pdf”, 620, 792, folderPath + “Conv_TestA_2.pdf”);
ChangePageSize2(folderPath + “TestB.pdf”, 620, 792, folderPath + “Conv_TestB_2.pdf”);
Console.WriteLine(“First (2) Approach - Complete”);

//Trird (3) Approach
ChangePageSize3(folderPath + “TestA.pdf”, 620, 792, folderPath + “Conv_TestA_3.pdf”);
ChangePageSize3(folderPath + “TestB.pdf”, 620, 792, folderPath + “Conv_TestB_3.pdf”);
Console.WriteLine(“First (3) Approach - Complete”);
Console.ReadLine();
}
private static void ChangePageSize1(string filePath, float pageWidth, float pageHeight, string newFilePath)
{
Document doc = new Document(filePath); //Read the source file
PageCollection pageCollection = doc.Pages;
for (int i=1; i<= pageCollection.Count; i++) //Change page size on all the pages
{
Page pdfPage = pageCollection[i];
pdfPage.SetPageSize(pageWidth,pageHeight);
}
doc.Save(newFilePath); //Save file as new file
}
private static void ChangePageSize2(string filePath, float pageWidth, float pageHeight, string newFilePath)
{
PdfPageEditor pageEditor = new PdfPageEditor();
pageEditor.BindPdf(filePath);//bind pdf file
pageEditor.PageSize = Aspose.Pdf.Facades.PageSize.PageLetter; //Change size to letter size
pageEditor.Save(newFilePath); //Save file as new file
}
private static void ChangePageSize3(string filePath, float pageWidth, float pageHeight, string newFilePath)
{
PdfFileEditor pdfFileEditor = new PdfFileEditor();
pdfFileEditor.MakeNUp(filePath, newFilePath, 1, 1, Aspose.Pdf.Facades.PageSize.PageLetter);
}
private static void SetAsposeLicence(string folderPath)
{
Aspose.Pdf.License license = new Aspose.Pdf.License();
license.SetLicense(folderPath+“Aspose.Total.lic”);
}

Observation:
All 3 approaches fails on same documents/file. The original file opens with Adobe Reader.

Impact:
This has delayed our production implementation and increased our efforts on identifying root cause, retesting. Please help

Note: In intermediate versions we had issues in combining .pdf with .doc which was resolved in 7.1 but now with 7.1 we do see issue that some pdf files are not opening/processing.

danradunz:
Issue:
Issue in converting few .pdfs to Letter size .pdf files.

Details:
The existing code (Aspose 4.0) stopped working after migrating to newer version (7.1) of Aspose.Pdf.
Tested the code with 3 different approaches and still see same issue.

Observation:
All 3 approaches fails on same documents/file. The original file opens with Adobe Reader.
Hi John,

Thanks for using our products.

I
have tested the scenario and I am able to reproduce the same problem. For the
sake of correction, I have logged it in our issue tracking system as PDFNEWNET-34868. We
will investigate this issue in details and will keep you updated on the status
of a correction. <o:p></o:p>

We apologize for your inconvenience.

danradunz:
Note: In intermediate versions we had issues in combining .pdf with .doc which was resolved in 7.1 but now with 7.1 we do see issue that some pdf files are not opening/processing.
Can you please share the source files i.e. PDF/DOC which are causing issue while concatenating, so that we can test the scenario at our end.

Nayyer -

Thank you for your reply. The PDF/DOC concatenating issue is resolved after using 7.1.
Now we have issue with changing the page size on few PDFs. We do see that you have created issue PDFNEWNET-34868 in your issue tracking system to address the issue.

Can you please give any estimate to us on when you can have answer on this?

Hi John,


As we just have noticed the issue PDFNEWNET-34868 and until or unless development team has been able to figure out the actual reasons of this problem, I am afraid we might not be able to share an timelines regarding its resolution. Nevertheless, as soon as we have made some significant progress towards its resolution, we would be more than happy to update you with the status of correction. Please be patient and spare us little time.

Your patience and comprehension is greatly appreciated in this regard.

PS, Every issue is investigated/resolved as per its priority/schedule.

The issues you have found earlier (filed as PDFNEWNET-34868) have been fixed in Aspose.Pdf for .NET 7.8.0update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.