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

System.IndexOutOfRangeException: Index was outside the bounds of the array. #440

Open
petr-vojtech opened this issue May 14, 2024 · 0 comments

Comments

@petr-vojtech
Copy link

Hello.
I use PdfSharpCore version 1.3.63 (.NET Core 6) to generate a PDF-file with code like this:
var pdf = PdfGenerator.GeneratePdf(html, PageSize.A4, 10, null, null, null);

I get an exception if I call this code simultaneously in two or more threads:
System.IndexOutOfRangeException: Index was outside the bounds of the array.
at PdfSharpCore.Fonts.OpenType.OpenTypeFontface.CreateFontSubSet(Dictionary`2 glyphs, Boolean cidFont)
at PdfSharpCore.Pdf.Advanced.PdfCIDFont.PrepareForSave()
at PdfSharpCore.Pdf.Advanced.PdfType0Font.PrepareForSave()
at PdfSharpCore.Pdf.Advanced.PdfFontTable.PrepareForSave()
at PdfSharpCore.Pdf.PdfDocument.PrepareForSave()
at PdfSharpCore.Pdf.PdfDocument.DoSave(PdfWriter writer)
at PdfSharpCore.Pdf.PdfDocument.Save(Stream stream, Boolean closeStream)

Can you plese solve the issue?
Thank you

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