We have found that a PDF that has been modified using a specific feature of our Document Management System (OnBase), cannot be resized using SetPageSize. Here is a simplified version of the code:
// load the source PDF document
PdfFileInfo fileInfo = new PdfFileInfo(filename);
PageCollection pageCollection = fileInfo.Document.Pages;
for (int i = 1; i <= pageCollection.Count; i++)
{
Page pdfPage = pageCollection[i];
pdfPage.SetPageSize(1728, 2592);
}
fileInfo.Save(filename_resized);
I have uploaded samples of the same file before and after it has been modified. Executing the code on the ‘Before’ file resizes successfully. Executing the code on the ‘After’ file does not cause any exception to occur, but the resulting PDF is not resized.
We would like to determine if there is a different approach that would successfully resize the file, or if anything can be detected in the ‘After’ file that would indicate that the file cannot be resized. SetPageSize does not have a return value, so it appears the only way we would be able to confirm the file has resized is by checking the size again.
We were able to reproduce the issue in our environment while using Aspose.PDF for .NET 20.5 and logged it as PDFNET-48188 in our issue tracking system. We will further look into its details and keep you posted with the status of its rectification. Please be patient and spare us some time.
I just wanted to check in on this issue. Is there anything you can tell me about the conditions in the PDF that may cause this issue? We are seeing more PDFs that we cannot modify, and we are wondering if there is something we can do to prevent this issue while we wait for the fix to Aspose.
Regretfully the ticket is not yet resolved and pending for analysis. Please note that issues are resolved on first come first serve basis and we will be able to share some work around or fix once the issue is fully investigated. We greatly appreciate your patience in this matter. Please spare us some time.
We really regret to inform that the earlier logged ticket could not get resolved yet. We are sorry that we cannot share any workaround at the moment before the ticket is fully investigated. However, we have recorded your concerns and will surely consider them during investigation. Your patience is highly appreciated in this regard. Please give us some time.
We were able to reproduce the issue with your file while using 22.7 version of the API. Therefore, we have logged it as PDFNET-52167 in our issue tracking system. We will further look into its details and keep you posted with the status of its correction. Please be patient and spare us some time.