SetPageSize does not modify size on some PDFs

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.

After Modification.PDF (52.7 KB)
Before Modification.pdf (53.6 KB)

Thanks!
Brian

@bhyatt

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.

We are sorry for the inconvenience.

Hello,

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.

Thanks!
Brian

@bhyatt

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 are sorry for the inconvenience.

Hello,

Are there any updates on resolving this, or any insight into the cause so we could try to detect and handle it?

Thanks!
Brian

@bhyatt

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 apologize for your inconvenience.

Hi I believe I am having the same issues. Please see my attached samples and code. Will this ever be addressed?

PdfPageSize.zip (544.1 KB)

@ccuster68

We are checking it and will get back to you shortly.

@ccuster68

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.

We are sorry for the inconvenience.