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

PDFsharp/MigraDoc 1.50 beta 4 available
https://forum.pdfsharp.net/viewtopic.php?f=1&t=3632
Page 1 of 1

Author:  TH-Soft [ Wed Jul 26, 2017 11:56 am ]
Post subject:  PDFsharp/MigraDoc 1.50 beta 4 available

Hello, everybody!

As of today, PDFsharp 1.50 beta 4 is available.

You can find the source code on SourceForge and CodePlex:
https://sourceforge.net/projects/pdfsha ... ta%204%29/
https://pdfsharp.codeplex.com/releases/view/631450

You can find binaries (assemblies) on NuGet. Make sure to check "Include prerelease" in the NuGet Package Manager.

Note: New on NuGet are the Core, GDI, and WPF packages.
The Silverlight package was not yet updated on NuGet.
The Silverlight package will most likely be updated - ETA is before the ides of August, 2017.

The source on GitHub was also updated.

The ZIP files with the samples were not updated (yet). There were no changes since 1.50 beta 3b. The NuGet Package Manager will fetch the latest packages.


Please report all regressions versus 1.50 beta 3b.
Several bugs have been fixed - and hopefully there are no new bugs.

Author:  Lemi [ Wed Aug 02, 2017 11:58 am ]
Post subject:  Re: PDFsharp/MigraDoc 1.50 beta 4 available

Great news, thank you!! It helps and solves an issue with some pdf..

Author:  kensands [ Fri Aug 04, 2017 10:30 am ]
Post subject:  Re: PDFsharp/MigraDoc 1.50 beta 4 available

Looks really good. After I'd merged in a load of the font bits from the pdfsharper fork it's working great. and fixes issues I was having with a number of PDFs.

However... there is always a however!

I'm having to fight hard to stop .net throwing out of memory exceptions if I build up a pdf from a series of huge full colour PNGs. Adding pages with one png per page.
I have 9 pngs that are A4 (ish) at 600dpi. 5000+pixels by 8000+pixels. So yes when each goes through the bitmap bits I know I'm gonna be using 300MB or so. However it doesn't seem to let it go again, the memory usage goes 300>600>900>1200... Crash after 6 or 7 pages are added. I've tried lots of tweaking in the code, but the only thing I can do to get it to work is to run things in an apartment, save the pdf after each page, close everything, end the apartment thread, start a new one, open the pdf and then add page 2... etc etc.
I have builds of this version which will work but it seems I'm performing a hack to get around some 300MB object reference somewhere not being released. You'd think that's be easy to find but .net likes to hide the magic!

Author:  () => true [ Fri Aug 04, 2017 12:22 pm ]
Post subject:  Re: PDFsharp/MigraDoc 1.50 beta 4 available

kensands wrote:
However it doesn't seem to let it go again, the memory usage goes 300>600>900>1200... Crash after 6 or 7 pages are added.
You do not show any code.
Maybe "Dispose()" missing? Using "using" may help.
Maybe run in 64-bit mode to go beyond the 2 GiB limit of 32-bit processes.

Author:  kensands [ Sat Aug 05, 2017 3:45 pm ]
Post subject:  Re: PDFsharp/MigraDoc 1.50 beta 4 available

I'll sort out example code and files. going 64 bit, doesn't solve it, it just puts off the crash for a few more pages.

Author:  e420 [ Wed Aug 23, 2017 8:43 pm ]
Post subject:  Re: PDFsharp/MigraDoc 1.50 beta 4 available

1.50 beta 4 - Simplest WPF program instantly crashes but does not in beta3
------------------------------------------------------------------------------------------
The simplest WPF program creates a valid PDF but crashes after that without throwing an exception.

• VS2015
• New project ‘WPF Application’
• NuGet: PDFsharp-MigraDoc-wpf v1.50.4589-beta4
• .NET 4.5.2 (doesn’t actually matter, same with 4.6)
• Add simple button
• Add the following code

Code:
private void button_Click(object sender, RoutedEventArgs e)
{
   try
   {
      var document = new Document();
      var section = document.AddSection();

      section.AddParagraph("Hello World");

      var renderer = new PdfDocumentRenderer();
      renderer.Document = document;
      renderer.RenderDocument();

      // ... save to PDFfile here ...
   }
   catch (Exception ex)
   {
      MessageBox.Show(ex.ToString(), "Exception ...");
   }
}


• Run
• Program crashes and doesn’t even hit the catch block
• If you would save the document, you would get a valid PDF file but it crashes after that anyway (I left that code out for simplicity)

• Revert to beta3
• NuGet: PDFsharp-MigraDoc-wpf v1.50.4000-beta3
• Compile and Run
• No crash

If the experts could have a look, Many Thanks!
(+ Many thanks for sharing the project!)

Author:  () => true [ Fri Aug 25, 2017 11:41 am ]
Post subject:  Re: PDFsharp/MigraDoc 1.50 beta 4 available

e420 wrote:
If the experts could have a look, Many Thanks!
(+ Many thanks for sharing the project!)
The problem is caused by calling "_dc.Dispatcher.InvokeShutdown();"
This call was introduced to prevent PDFsharp on Azure servers from running out of resources.
Unwanted side effect: the WPF desktop application will be closed.
See here:
viewtopic.php?p=10149#p10149

The call to "_dc.Dispatcher.InvokeShutdown();" will be removed from the next version on NuGet.
For use on a server, get the source code package and uncomment that line.

Thanks for the feedback. Sorry for the inconvenience.
I have no idea how to help both usage cases with a single NuGet package.

Author:  () => true [ Fri Aug 25, 2017 12:23 pm ]
Post subject:  Re: PDFsharp/MigraDoc 1.50 beta 4 available

() => true wrote:
The call to "_dc.Dispatcher.InvokeShutdown();" will be removed from the next version on NuGet.
I can no longer replicate the issue with the current packages from NuGet:
PM> Install-Package PDFsharp-MigraDoc-WPF -Version 1.50.4619-beta4c

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