Free Support Forum - aspose.com

Concatenate Failing

I am attempting to use the pdf.kit to concatenate PDF documents (some of which already exist and some generated by aspose.word. I used the basic example in the documentation. but the method is returning False and I still have a 0 byte PDF file. The only thing that looked odd was this in the OwnerPassword property:

OwnerPassword = Write Only Properties are not supported

Is there an error object or someway to see why this is not working?

Thanks

Tom

Hi Tom,

Could you please share the input PDF files with us, so we could test the issue at our end? You’ll be updated with the results accordingly.

We’re sorry for the inconvenience.
Regards,

Sure - here they are. Not much to them. I have tried a bunch of files but nothing has worked so far.

Hi Tom,

I have tested this issue at my end using the latest version (5.5.0), but couldn’t reproduce the same problem. Could you please download the latest version (Aspose.Pdf.Kit for .NET 5.5.0) and try at your end? If it still doesn’t resolve your issue then please share some more details regarding your environment: OS and .NET Framework version.

We’re sorry for the inconvenience and looking forward to help you out.
Regards,

I was running 5.5.0.0 but downloaded and let it do a refresh anyway. It did not change anything though. I am running VS 2010 Developer on a 64bit Win7 box. .NET Framework is 3.5. I am building with the "Any CPU" parameter, setting it to "x86" accross the solution is not possible. I tried saving locally and on the server, but neither worked. I am not sure what is different but always get a return of fail and a 0 byte pdf file.

Is there an error or return object or something that will give me some more information?

Thanks

Hi Tom,

I have again tested this issue at my end using your particular scenario, but I’m still unable to reproduce the issue. Could you please try adding the following line of code in your application?


fileEditor.AllowConcatenateExceptions = true;

If you receive any exception this way then please share the details with us, so we could further investigate it. Also, it is very important for us to reproduce the issue at our end. Could you please also share a small sample application, which can help us reproduce the same issue at our end? Maybe there is something in the code you're using at your end, which is causing this problem.

We're sorry for the inconvenience and looking forward to help you out.
Regards,

Error message was a bit terse, here it is - but not sure what it means:

Exception occurred during the processing stream: 1

Is there an error message table somewhere?

Thanks

Hi Tom,

Actually, this is a generic exception and could be caused due to various reasons. However, in order to further investigate and then resolve this issue we need to reproduce the problem at our end. Could you please share a small application which can help us reproduce this issue over here?

We’re sorry for the inconvenience and looking forward to help you out.
Regards,

Good day

I see this issue was logged a while back and it’s frustrating to note that this is a generic message. I am getting the same issue and my company even downloaded the most recent DLLs, only for the issue to persist.

One thing that is clear is the fact that the issue is related to the environment. Both Development and QA servers do not have a problem, but when I deploy to the live box, I get the following exception:

Source: Aspose.Pdf.Kit
Message: Exception occurred during the processing stream: 1
Inner Exception: Exception occurred in method: GetTempFileName()
Stack Trace:
Target Site: x16518bba0f7b77c9

The code snippet is shown below:

private static byte[] MergePdfDocuments(IList<byte[]> letters)
{
AsposeLicenseManager.SetLicenses();
var outputStream = new MemoryStream();
try
{
var pfe = new PdfFileEditor();
var inStream = letters.Select(letter => new MemoryStream(letter)).ToList();

pfe.AllowConcatenateExceptions = true;
pfe.Concatenate(inStream.ToArray(), outputStream);
}catch(Exception ex)
{
Logging.WriteExceptionToDB(ex);
}
return outputStream.ToArray();
}

Please let me know if this sufficient information

Regards,

Peter

Hi Peter,


Thanks for contacting support.

As per my observations, you are using Aspose.Pdf.Kit for .NET to concatenate the PDF documents but Aspose.Pdf.Kit for .NET has been discontinued as separate product since October-2011. All its classes and enumerations have been merged under Aspose.Pdf.Facades namespace of Aspose.Pdf for .NET product. The older release versions of Aspose.Pdf.Kit used to create so temporary files during PDF concatenation and they are usually created in Temp folder and in case the particular user executing the application does not have permissions to temp folder, such exception occur.

Nevertheless, the issue related to temp files creation during PDF concatenation were resolved in recent release versions. I would recommend you to please try using the latest release version of Aspose.Pdf for .NET 7.8.0 and in case the problem still persists, please share some sample application which can help us in replicating this issue at our end.

Besides using PdfFileEditor class to concatenate PDF files, we recommend using Document class present under Aspose.Pdf namespace to concatenate PDF files. Please visit the following links for further information on


We are sorry for this inconvenience.