Hi all,
I have recently had exactly the same problem and have found the cause and a workaround.
The issue is with the format of the PDF rendered by the SQL Reporting Services web service, specifically the version comment at the start of the data. According to the Adobe PDF specification the version comment should be of the format :
%PDF-1.3
followed immediately by either a carriage return (0xd) a line feed (0xa) or both (0xd 0xa).
But the format produced by the PDF renderer is of the following format:
%PDF-1.3%
followed by a carriage return & line feed. Note the extra % at the end this is what is causing the problem when the PdfContentEditor parses the PDF file.
Whether this is a bug in Reporting Services or in the Aspose PdfContentEditor is a matter for debate since the '%' character in the PDF is a comment delimiter and strictly should be ignored, but the PDF specification does not say explicitly whether tor not the trailing '%' is correct.
Aspose will have to debate this with Microsoft and Adobe!!!
There is however a workaround, the PDF stream/file can be modified directly and the offending '%' character removed prior to calling PdfContentEditor.BindPDF.
Example using the Reporting Services web service:
byte[] report = service.Render(reportName , <...additional parameters removed...>);
// overwrite the trailing '%'
report[8] = 0x0; // Alternatively can use space (0x20) or zero (0x30) characters
Hope this helps someone.
(This is all using Aspose.Pdf.Kit version 2.6)
Regards,
Nigel Rutter