Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ICSharpCode.SharpZipLib Unexpected EOF #451

Open
toolgood opened this issue Aug 4, 2024 · 0 comments
Open

ICSharpCode.SharpZipLib Unexpected EOF #451

toolgood opened this issue Aug 4, 2024 · 0 comments

Comments

@toolgood
Copy link

toolgood commented Aug 4, 2024

            using (var ms = new MemoryStream(file)) {
                var document = PdfReader.Open(ms);
                if (SetFontResolver == false) {
                    SetFontResolver = true;
                    GlobalFontSettings.FontResolver = new FontResolver();
                }

                foreach (var page in document.Pages) {
                    var content = ContentReader.ReadContent(page);  //error

CustomMsg: Microsoft Windows NT 6.3.9600.0 8.0.7.-1
Message:Unexpected EOF
Source:ICSharpCode.SharpZipLib
StackTrace: at ICSharpCode.SharpZipLib.Zip.Compression.Streams.InflaterInputStream.Fill()
at ICSharpCode.SharpZipLib.Zip.Compression.Streams.InflaterInputStream.Read(Byte[] buffer, Int32 offset, Int32 count)
at PdfSharpCore.Pdf.Filters.FlateDecode.Decode(Byte[] data, FilterParms parms)
at PdfSharpCore.Pdf.Filters.Filter.Decode(Byte[] data, PdfDictionary decodeParms)
at PdfSharpCore.Pdf.Filters.Filtering.Decode(Byte[] data, PdfItem filterItem, PdfItem decodeParms)
at PdfSharpCore.Pdf.Advanced.PdfContent.Decode()
at PdfSharpCore.Pdf.Advanced.PdfContent..ctor(PdfDictionary dict)
at PdfSharpCore.Pdf.PdfPage.get_Contents()
at PdfSharpCore.Pdf.Content.CParser..ctor(PdfPage page)
at PdfSharpCore.Pdf.Content.ContentReader.ReadContent(PdfPage page)
at ToolGood.GearReducer.Infrastructure.PdfHelper.AddTexts(Byte[] file, List`1 items, String watermarkPath) in E:\somain\ToolGood.GearReducer_sk\src-en\ToolGood.GearReducer.Infrastructure\PdfHelper.cs:line 122
at ToolGood.GearReducer.Pages.Download.PdfFileModel.OnPostAsync(String n) in E:\somain\ToolGood.GearReducer_sk\src-en\ToolGood.GearReducer\Pages\Download\PdfFile.cshtml.cs:line 123
at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.ExecutorFactory.GenericTaskHandlerMethod.Convert[T](Object taskAsObject)
at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.ExecutorFactory.GenericTaskHandlerMethod.Execute(Object receiver, Object[] arguments)
at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.InvokeHandlerMethodAsync()
at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.InvokeNextPageFilterAsync()
at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.Rethrow(PageHandlerExecutedContext context)
at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.InvokeInnerFilterAsync()
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|26_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant