PDFsharp & MigraDoc Foundation
https://forum.pdfsharp.net/

PDF Sharp can't handle SQL Server 2008 PDF reports
https://forum.pdfsharp.net/viewtopic.php?f=2&t=674
Page 1 of 1

Author:  ballinator [ Wed Mar 11, 2009 10:22 pm ]
Post subject:  PDF Sharp can't handle SQL Server 2008 PDF reports

We use PDFSharp to concatenate multiple reporting services PDF reports into a single document using the AddPage method on the PDFSharp PDF Document. When we use SQL Server 2005 Reporting Services, this works fine. When we use SQL Server 2008 Reporting Services, the resultant concatenated PDF report shows just a blank page for each page we added. We know the Reporting Services 2008 PDF source is good because we can save it as it is to a database and later we can retrieve it and it displays fine. I see no comments on the PDF release notes about SQL Server 2008 Reporting services. In stepping through the code I noticed two things (and keep in mind, I'm creating the exact same report with the exact same data using the exact same code on the same exact workstation except that in one case I'm using 2005 Reporting Services and in the other I'm using 2008 Reporting Services):
1. The Reporting services 2005 PDF memory stream is about 97K in size while the Reporting Services 2008 PDF memory stream is 7.5K in size.
2. The PDFReader.cs class Open method throws an exception while processing a memory stream into a PdfDocument but this exception gets swallowed up by this method (An unexpected symbol) so you never see anything. This only happens with the 2008 PDF file. No exception occurs with the 2005 PDF file.

Author:  Thomas Hoevel [ Thu Mar 12, 2009 8:39 am ]
Post subject: 

Hi!

This is a known problem.
Sorry, but we don't have time to fix it right now.

Can you set the PDF file version of the reports? AFAIK there is no problem with PDF files that are compatible with Acrobat Reader 5.0 (PDF 1.4).

Author:  ballinator [ Tue Mar 17, 2009 8:25 pm ]
Post subject:  We cannot request a PDF version from reporting services

We checked and SQL Server 2008 reporting services generates PDF version 1.3 files, which is the same PDF version that Sql Server 2005 reporting services generates. Unfortunately, there is no way to request a differing PDF report version when requesting a reporting services report.

Report Services 2008:
http://technet.microsoft.com/en-us/libr ... 59713.aspx

Report Services 2005:
http://technet.microsoft.com/en-us/libr ... 713(SQL.90).aspx

Is there another way to create a "PDFDocument" object than just passing in the memory stream that reporting services generates?

Author:  ballinator [ Wed Mar 18, 2009 11:05 pm ]
Post subject: 

We think we figured it out in that SSRS (Sql Server Reporting Services) 2008 compresses the PDF files while SSRS 2005 did not. Is this what is causing the problem?

Author:  Thomas Hoevel [ Thu Mar 19, 2009 8:03 am ]
Post subject: 

That's not my area of expertise but AFAIK new PDF versions allow references where old PDF versions required direct data. Some of these references are not implemented in PDFsharp.
But maybe new PDF versions allow compressed streams where old PDF versions required uncompressed streams.

This is a known problem.
Sorry, but we don't have time to fix it right now.

Author:  ballinator [ Thu Mar 19, 2009 3:13 pm ]
Post subject:  Found the way to disable PDF compression

For the DeviceSettings parameter for the Render method on the ReportExecutionService object, pass this value:

theDeviceSettings = "<DeviceInfo><HumanReadablePDF>True</HumanReadablePDF></DeviceInfo>";

This disables PDF file compression for SSRS 2008. Then, PDFSharp is able to handle the resulting uncompressed PDF file. (Note: SSRS 2005 ignores this setting so it can be passed to both SSRS versions.)

Author:  strazz [ Thu Aug 20, 2009 6:36 pm ]
Post subject:  Re: PDF Sharp can't handle SQL Server 2008 PDF reports

THANK YOU for the devicesettings information. That totally worked!

Now... for the problem :( Apparently this setting has affected the reporting services ability to process "curly" quotes and apostrophes.

I've made a very detailed post on the ASP.NET forums about it, hopefully someone has time to take a look... I think they may be stumped over there :) I've referenced this forum in my ASP.NET post.

http://forums.asp.net/p/1460993/3357385.aspx

Thank you everyone for your time.

-Robert

Author:  strazz [ Mon Aug 31, 2009 4:56 am ]
Post subject:  Re: PDF Sharp can't handle SQL Server 2008 PDF reports

Any word on when we can merge SSRS 2008 PDFs possibly without using the deviceSettings parameter? (this causes reports to render incorrectly.)

Author:  joshp97 [ Fri May 14, 2010 3:15 pm ]
Post subject:  Re: PDF Sharp can't handle SQL Server 2008 PDF reports

Does anyone have an update to this issue? It would definitely be nice to be able to combine compressed files.

Author:  Thomas Hoevel [ Mon May 17, 2010 7:26 am ]
Post subject:  Re: PDF Sharp can't handle SQL Server 2008 PDF reports

Maybe this post can help:
viewtopic.php?p=3138#p3138

Author:  joshp97 [ Mon May 17, 2010 4:24 pm ]
Post subject:  Re: PDF Sharp can't handle SQL Server 2008 PDF reports

thanks Thomas. I'll give that a shot.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/