ststeiger / PdfSharpCore

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

Exception error proyect .Net Maui #325

Open x71hicks opened 1 year ago

x71hicks commented 1 year ago

proyect en net.maui in Net 7.0

{ String filePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "xxx.pdf");

Document document = new Document();

Section section = document.AddSection();

        Paragraph paragraph = section.AddParagraph();

        paragraph.Format.Font.Color = Color.FromCmyk(100, 30, 20, 50);

        paragraph.AddFormattedText("Hello, World!", TextFormat.Bold);

        PdfDocumentRenderer printer = new PdfDocumentRenderer();
        printer.Document = document;
        printer.RenderDocument();  **--> line exception**
        printer.PdfDocument.Save(filePath);

        await Launcher.OpenAsync(new OpenFileRequest
        {
            File = new ReadOnlyFile(filePath)
        });

}

System.ArgumentNullException: 'Value cannot be null. (Parameter 'stream')'

thank you

AlessandroLanzoni commented 1 year ago

I have the same error.

ghost commented 1 year ago

Do you guys find any fix for this?

AlessandroLanzoni1991 commented 10 months ago

No, I wait for an Update targets .net 8