PDF Splitting

Hi there,

I use the following function to extract the first three pages from a pdf document:

internal bool PDFPages(string fileNameIn, int firstPage, int pageCount, string fileNameOut)
{
var docIn = new Aspose.Pdf.Document(fileNameIn);
if (firstPage + pageCount > docIn.Pages.Count) return false;

var docOut = new Aspose.Pdf.Document();
for (var page = firstPage; page < firstPage + pageCount; page++)
{
docOut.Pages.Add(docIn.Pages[page]);
}
//docOut.Optimize();
docOut.Save(fileNameOut);
return true;
}

Now, using the attached document the output file is bigger than the input file. When I optimize the document before saving the file is corrupted…

What is wrong?

Greetings,

Markus

Hi Markus,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for sharing the template file and sample code.

I am able to generate both of your issues and registered them in our issue tracking system as mentioned below:

PDFNEWNET-33435: File Size Increases when adding pages to new document.

PDFNEWNET-33436: Optimize Corrupts the generated file.

You will be notified via this forum thread regarding any updates against your issues.

Sorry for the inconvenience,

Hi Nausherwan,

I found out that a slight increase in size is due to a missing license and therefore the addition of a watermark and/or comment line.

To figure if the rest of the problems also rise from that issue I requested a temporary license for now…

CU,

m:

Hi Markus,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for the feedback.

Please perform your test with the temporary license and in case you still face any issue, please do let us know.

Thank You & Best Regards,

Hi,

just tried - Watermarks are gone - Problem remains…

CU

Hi Markus,

Thank you for the feedback.

As your issues are already registered in our issue tracking system and our development team will look into your issues. You will be notified via this forum thread regarding the resolution of the issues.

Sorry for the inconvenience,

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


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

Hi,

the problem of a document being corrupted by optimizing it remains. At least for the provided sample…

Greetings,

Markus

Hi Markus,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Aspose.Pdf for .NET v7.0 includes the fix of PDFNEWNET-33435 (File Size Increases when adding pages to new document) and the issue PDFNEWNET-33436 (Optimize Corrupts the generated file.) is not yet resolved. I have asked the development team to share an ETA regarding PDFNEWNET-33436. As soon as I get an update, I will notify you via this forum thread.

Sorry for inconvenience,

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

The blog post for this release is created over this link


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.