PDFsharp & MigraDoc Foundation
https://forum.pdfsharp.net/

PDF locked until process exits with 1.50 Beta 3
https://forum.pdfsharp.net/viewtopic.php?f=3&t=3242
Page 1 of 1

Author:  johnzered [ Wed Dec 09, 2015 11:01 am ]
Post subject:  PDF locked until process exits with 1.50 Beta 3

With prior versions there has been no problem to open a created PDF with another tool while the program which created it is still running. Now with beta 3 you either have to wait for the program to exit or kill the process.

You can test this by using the following code eg. in a Console application:
Code:
using (var doc = new PdfDocument())
{
    var page = doc.AddPage();
    XGraphics gfx = XGraphics.FromPdfPage(page);
    XFont font = new XFont("Verdana", 20, XFontStyle.Bold);
    gfx.DrawString("Hello, World!", font, XBrushes.Black, new XRect(0, 0, page.Width, page.Height), XStringFormats.Center);

    page.Close();
    doc.Save(@"C:\Temp\test.pdf");
}

Console.ReadKey();


Put a breakpoint on ReadKey and try to open the created PDF using your PDF reader. With beta 3 it will tell you the file is locked.

Author:  Thomas Hoevel [ Wed Dec 09, 2015 11:57 am ]
Post subject:  Re: PDF locked until process exits with 1.50 Beta 3

AFAIK we found and fixed this bug.
I think there will be a beta 3a or beta 4 soon.

I'm sorry for the inconvenience (even though it wasn't my bug :wink: ) and thank you for your feedback.

Author:  Thomas Hoevel [ Wed Dec 09, 2015 1:44 pm ]
Post subject:  Re: PDF locked until process exits with 1.50 Beta 3

Fixed with beta 3a released today.

Author:  johnzered [ Thu Dec 10, 2015 6:32 am ]
Post subject:  Re: PDF locked until process exits with 1.50 Beta 3

Thomas Hoevel wrote:
Fixed with beta 3a released today.
Yup, now it's working again, thank you!

Thomas Hoevel wrote:
I'm sorry for the inconvenience (even though it wasn't my bug :wink: ) and thank you for your feedback.
As long as there's someone to blaim! :lol:

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