PDFsharp & MigraDoc Foundation
http://forum.pdfsharp.com/

SharpZipBaseException on calling XGraphics.FromPdfPage
http://forum.pdfsharp.com/viewtopic.php?f=3&t=3365
Page 1 of 1

Author:  wim [ Tue May 24, 2016 4:39 pm ]
Post subject:  SharpZipBaseException on calling XGraphics.FromPdfPage

For a lot of PDF pages I get a SharpZipBaseException when calling XGraphics.FromPdfPage.
The exception is thrown in InflaterInputStream.Fill() with message "Unexpected EOF".

I can 'fix' this problem using a hack in InflaterInputStream.Read:

Code:
....
if (inf.IsNeedingInput)
{
    try
    {
        Fill();
    }
    catch(SharpZipBaseException)
    { // WB! early EOF: apparantly not a big deal for some PDF pages: break out of the loop.
        break;
    }
}
...



Attachments:
File comment: Example file that needs the fix for all pages.
Suite - Corelli - Viool 1 nieuw.zip [54.33 KiB]
Downloaded 916 times

Author:  Thomas Hoevel [ Tue Aug 16, 2016 1:12 pm ]
Post subject:  Re: SharpZipBaseException on calling XGraphics.FromPdfPage

Thanks for the patch and the test PDF.
I included it in the current internal build.

Author:  rogdo [ Mon Jan 29, 2018 6:55 am ]
Post subject:  Re: SharpZipBaseException on calling XGraphics.FromPdfPage

Hi, I'm getting the same exception with the same file. How can I use the above patch in order to fix it?

Author:  Thomas Hoevel [ Mon Jan 29, 2018 9:09 am ]
Post subject:  Re: SharpZipBaseException on calling XGraphics.FromPdfPage

rogdo wrote:
How can I use the above patch in order to fix it?
Download the source code, make the change, compile, enjoy.
An adapted version of this patch is already included with beta 5.

Author:  rogdo [ Mon Jan 29, 2018 5:50 pm ]
Post subject:  Re: SharpZipBaseException on calling XGraphics.FromPdfPage

Thomas, first of all thank you - I installed the new version of pdfsharp for wpf and it solved many problems.

However, now I get a new error now when i try to install my published app - it says:

"unable to install or run the application. the application requires that assembly pdfsharp-wpf version 1.32.2608.0 be installed in the Global Assembly Cache (GAC)"

Any idea?

sorry for nagging :(

Author:  rogdo [ Mon Jan 29, 2018 9:39 pm ]
Post subject:  Re: SharpZipBaseException on calling XGraphics.FromPdfPage

I was able to solve this issue.

I changed pdfsharp-wpf and charting to be included (instaed of prerequisite) and then put them under a new download group.

Author:  rogdo [ Mon Feb 05, 2018 6:57 pm ]
Post subject:  Re: SharpZipBaseException on calling XGraphics.FromPdfPage

correction - needed to exclude those files

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