Free Support Forum - aspose.com

PdfFileEditor.Append returning false and blank output

Is there a way to tell WHY the Append returns false and blank output? This only happens in one of our many environments and we cannot get any useful output telling us why Append is unsuccessful. Is there a logging method or error message somewhere we can look at to find out why?

This exact same behavior occurs with the Concatenate method

Hi Michael,

First off, please try to use the latest merged Aspose.Pdf for .NET. Please note that the versions 6.0.0 and above of Aspose.Pdf for .NET are part of the merged version. This component contains features of both Aspose.Pdf and Aspose.Pdf.Kit.

If you still find the same problem then please share the input PDF files along with the code snippet with us, so we could further investigate the issue at our end.

We’re sorry for the inconvenience.
Regards,

Using 6.0.0 seems to have fixed the problem .We tried 5.8.0.0 yesterday and it didn’t help. As some background for anyone else thinking they see this same issue, the files that were being used by Aspose were not being released (can’t be opened or deleted in windows etc.) after running the Attach/Concatenate method.

Hi Michael,

I’m glad to know that the issue is resolved at your end. If you find any further questions, please do let us know.

Regards,

I would still like to know if there is any way to get the reason for a false and empty output from Append/Concatentate. There are some instances where this happens (not anywhere near as often as our error the other day) where we cannot find a way to fix the appending and need it to work. Is there a debug flag we can set or something in the API?

Hi Michael,

I’m sorry to share with you that currently there is no way to find out the reason of false return value or empty output file. However, I have logged a new feature request as PDFNEWNET-29870 in our issue tracking system. You’ll be notified via this forum thread once it is supported.

We’re sorry for the inconvenience.
Regards,

Actually it seems that there is one method, at least to get the exception thrown by Aspose:

var editor = new PdfFileEditor {AllowConcatenateExceptions = true}
This wasn’t documented anywhere I could find and I only stumbled on it going through the intellisense in Visual Studio.

Hi Michael,

You’re right, AllowConcatenateExceptions property allows you to throw exceptions while concatenating PDF files. Does it work for you in case of Append as well? Moreover, if the exception thrown after setting this property helps in your scenario then I’m glad to know that.

If you find any further questions, please do let us know.
Regards,

Hi Michael,

As per your request, we have added to properties to show the details of exception that occur during PDF manipulation process.

  1. Set PdfFileEditor.AllowConcatenateExceptions property to true to throw exception on error instead of returning false.
  2. Set PdfFileEditor.LastException to true, to get the details of last error occurred if exceptions are not thrown due to AllowConcatenateExceptions value.

These two properties will be available in new release version of Aspose.Pdf for .NET 6.3.0. Please be patient and wait for the new release.


The issues you have found earlier (filed as 29870 ) have been fixed in this update.


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