We use Aspose.Pdf to concatenate PDFs. In an earlier release of our application we have worked with version 6.2, now we have upgraded to version 6.4.
The pdf concatenation is started form a web application where the users can choose the display language of the web UI. The Current Culture is set on the CurrentThread.
With release 6.4 we have the following issue: When the user chooses the UI language English (LCID 1033) everything is fine. When he changes the UI language to German (LCID 1031) (or French, Italian), the resulting PDFs are not correct. I get the following error messages when I open the generated PDF in Adobe Reader and the document could not be read:
“There was an error processing a page. There was a problem reading this document (110).”
When I make a file compare of two files that were generated from the same input pdfs, one time with LCID 1033 and one time with LCID 1031 I get such differences:
LCID 1033:
<>stream
LCID 1031:
<>stream
LCID 1033:
[/Separation/PANTONE#202955#20C 955 0 R<>]
LCID 1031:
[/Separation/PANTONE#202955#20C 955 0 R<>]
The files that are not working correctly are containing commas “,” instead of dots “.”.
var lcidStr = this.Request[UrlParameters.Lcid];
var lcid = 0;
if (lcidStr != null && int.TryParse(lcidStr, out lcid))
{
var cultureInfo = new CultureInfo(lcid);
Thread.CurrentThread.CurrentUICulture = cultureInfo;
Thread.CurrentThread.CurrentCulture = cultureInfo;
}
The concatenation is happening like this (code shorted):
List streams = new List();
// for each file:
streams.Add(new MemoryStream( /* file as byte [] */ ));
var mergedPresentations = ConcatenatePdfStreams(streams.ToArray());
// …
public byte[] ConcatenatePdfStreams(Stream[] fileStreams)
{
var pdfStream = new MemoryStream();
PdfFileEditor pdfFileEditor = new PdfFileEditor();
pdfFileEditor.Concatenate(fileStreams, pdfStream);
return pdfStream.ToArray();
}
-> Please escalate this issue to Priority Support