ststeiger / PdfSharpCore

Port of the PdfSharp library to .NET Core - largely removed GDI+ (only missing GetFontData - which can be replaced with freetype2)
Other
1.08k stars 237 forks source link

Unexpected token 'Gulim' in PDF stream. #279

Open dellos opened 2 years ago

dellos commented 2 years ago

the Error was

image image

        PdfDocument newPdf = new PdfDocument();

        foreach (string pdf in pdfFilePaths)
        {
            PdfDocument importPdf = PdfReader.Open(pdf, PdfDocumentOpenMode.Import); //this line will raise error

            foreach (var pdfPage in importPdf.Pages)
            {
                newPdf.AddPage(pdfPage);
            }

            importPdf.Close();
        }

        newPdf.Save(newFile);
        newPdf.Close();

I cheked and All Pdf files created can open successfully Note: same code run in other computer will not raise error!!! Is there a change that PC setting effect the library ?

dellos commented 2 years ago

In Parse.cs pdfObject = ReadDictionary(dict, includeReferences);// some time was rise error