We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

V4.4.0.0 Corrupt PDF

I just installed v4.4.0.0 and attempted to create a concatenated pdf using logic I previously had working as a result of the below thread and installing patch v4.3.2.0.
<a href="https://forum.aspose.com/t/116287</a><div><br></div><div>Now I am getting an error when Adobe opens:</div><div>"There was an error processing a page. There was a problem reading this document (14)"

The resulting pdf file is attached

Hi Eric,

Please share the input PDF files with us, so we could test the issue at our end. You’ll be updated accordingly.

We’re sorry for the inconvenience.
Regards,

I am getting corrupt PDF’s as well with PDF files created by Aspose Words using pdf.kit to concatenate.

Hi Robert,

We have noticed a similar issue and logged it as PDFKITNET-16789 in our issue tracking system. Our team is looking into this issue and you’ll be updated via this forum thread once it is resolved.

We’re sorry for the inconvenience.
Regards,

Hi, I have also seen this problem when contatenating certain combinations of source files. Is it recommended to revert to 4.3, or is there a workaround available?

EDIT: This is when using the method PdfEditor.Concatenate(string firstInputFile, string secInputFile, string outputFile)

Hi Joacim,

Our team is currently working on this issue and the fix will be available in our upcoming monthly release; however, in the meanwhile, you can use the previous version 4.3. Moreover, in order to make sure that the upcoming fix works fine for your scenario as well, we need to test the issue with your files too. Please share the problematic PDF files with us, so we could test the issue at our end.

We’re sorry for the inconvenience.
Regards,

I’m afraid this has only occured for customers, using confidential documents. I’ll see if we can recreate the error using anonymized data though.

The data we are having problems with is also confidential and I tried to create some dummy data to reproduce this problem with. To be honest, I am having so many problems with this version of the dll i don't know where to start. My application takes a report that is a pdf stream then merges that wtih a pdf conversion of any attachments to that record. Then it adds a dynamically created html file that is converted to pdf to end of the document. I can't get any of those functions to work now. The html file won't even convert now. Seems like these problems should be easy to reproduce given the number of us complaining about them. Perhaps the following will be helpful. The files I am using are all streams and the problems seems to be with the concatenation method?

Hi Joacim and Eric,

Please download the attached hot fix and try to concatenate the files using this hot fix. I hope it is going to resolve your issue, however if you still find the problem please do let us know.

We’re sorry for the inconvenience.
Regards,

This fixed one of my problems (concatenating a pdf stream to another pdf stream that was an inline HTML document) but concatenating a pdf stream to another pdf stream still does not work<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Hi Eric,

I’m sorry that the fix is not working for some of your files. Please share a small sample project with us along with the problematic PDF files, which can reproduce the issue at our end, so we could understand the issue properly and then resolve it.

We’re sorry for the inconvenience and appreciate your cooperation.
Regards,

I am working on a sample app now. Is there a way I can send you files and not have them publically visible?

Hi Eric,

You can Zip the project and files and use ‘Contact -> Send shahzad.latif an email’ option at the top of this post. If the Zip file is very large then you can upload it on some FTP server and share the credentials via email, so we could download it at our end.

I hope this helps. If you have any further questions, please do let us know.
Regards,

I am having a ton of difficulty getting my sample app to work. Part of the problem is my source files are typically memory streams coming from my external application. I am trying to get copies of those files that I have saved to disk loaded into a memory stream and then have my existing code take over from there. Problem I am now having is the streams I am creating appear to not be working. Can you provide a quick sample of code that will take 2 pdf files, load each into a memory stream and then concatenate those two pdfs together? Once I have that baseline working I should be able to merge that with my sample app<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Hi Eric,

Please find a sample below for your scenario. This sample allows you to read files and copy to the memory streams and then concatenates those streams:


//create input and output file streams to read and write files

FileStream fileStream1 = new FileStream(“input1.pdf”, FileMode.Open);

FileStream fileStream2 = new FileStream(“input2.pdf”, FileMode.Open);

FileStream fileOutput = new FileStream(“output.pdf”, FileMode.Create);


//read first file into memory stream

byte[] data = new byte[fileStream1.Length];

fileStream1.Read(data,0,data.Length);

MemoryStream mStream1 = new MemoryStream(data, 0, data.Length);


//read second file into memory stream

data = new byte[fileStream2.Length];

fileStream2.Read(data,0,data.Length);

MemoryStream mStream2 = new MemoryStream(data,0,data.Length);


//create output memory stream

MemoryStream outStream = new MemoryStream();


//concatenate two input streams and write to output stream

PdfFileEditor fileEditor = new PdfFileEditor();

fileEditor.Concatenate(mStream1,mStream2, outStream);


//read output memory stream and write to output file stream

outStream.Position = 0;

data = new byte[outStream.Length];

outStream.Read(data, 0, data.Length);

fileOutput.Write(data, 0, data.Length);


//close file streams

fileOutput.Close();

fileStream1.Close();

fileStream2.Close();


//close memory streams

mStream1.Close();

mStream2.Close();

outStream.Close();

I hope this helps. If you have any further qeustions, please do let us know.
Regards,



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


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

I have upgraded to version 4.5.0.0 and the problem still exists. With the help of your sample code I was able to create a very simple application that replicates the problem. I have attached the application and the documents that are included are generic so there is no issue with posting them here in the public area.


If I replace Aspose.pdf.kit with version 4.3.0.2 this sample project works with no issues so something was introduces in 4.4 (or later) that is causing this.

Thanks

Hi Eric,

I have tested the sample files at my end and noticed the same problem. This issue has been logged as PDFKITNET-17430 in our issue tracking system. Our team will look into this issue and you’ll be updated via this forum thread once it is resolved.

I would also like to add that the files you shared earlier (for which the issue was resolved) work fine with version 4.5.0. However, the new files you shared in your last post have problem; most probably the issue is caused due the particular contents or structure of the PDF files. Our team will investigate this scenario and you’ll be updated with a fix accordingly.

We’re sorry for the inconvenience.
Regards,

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


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