PDFsharp & MigraDoc Foundation

PdfSharp - Bad quality PDF
Page 1 of 1

Author:  Pieter [ Thu Oct 14, 2021 11:43 am ]
Post subject:  PdfSharp - Bad quality PDF


I'm using PdfSharp for several years on 1 site with several subdomains.
One of the subdomains refuses to output good quality PDF's whilst the website is running on the same code as all the other subdomains and main domain where the PDF's are in good quality.

I don't get it how this one subdomain (which is coded like all the other subdomains ) can output this bad quality.

I've added original size file -> this is the HTML blob which is the same on every subdomain
Then I've added a good skin image, this is a screen taken from a PDF which is created from a good subdomain
Then I've added a bad skin image, taken from a PDF from that one bad subdomain

My question, what can influence the quality of the PDF ?
Playing with the document.CompressionLevel and/or JPEG compression levels has no effect because al the sub domains are running on the same code base.

My application is running in ASP.NET, C# back-end.
any ideas?

Thanks in advance

File comment: This is output from the bad subdomain in the PDF, unreadable
bad_skin.jpg [ 182.48 KiB | Viewed 521 times ]
File comment: this is rendered from the original html in a good subdomain, almost no quality loss
good_skin.jpg [ 164.9 KiB | Viewed 521 times ]
File comment: this is a screen coming from the website itself, so this is still HTML so all is good quality
original_size.jpg [ 174.26 KiB | Viewed 521 times ]

Author:  TH-Soft [ Wed Oct 20, 2021 6:49 am ]
Post subject:  Re: PdfSharp - Bad quality PDF

OK, so it is quiz time. No code showing in the question.

What do we know for sure? PDFsharp does not render HTML to PDF.

So most likely the problem is not with PDFsharp, but with some third-party code (which?).
Since it works on some computers, there must be a way to configure the behaviour. Consult the documentation of your third-party tool.

Author:  Pieter [ Wed Oct 20, 2021 7:15 am ]
Post subject:  Re: PdfSharp - Bad quality PDF


I didn't add any code because it has no purpose because some sites were running fine which means the code was OK.
Coincidence but yesterday evening we found the issue.
It was the identity of the application pool which was not set to a Network service.
Why this downgraded the quality of a PDF is still a mistory but changing this from ApplicationPoolIdentity to a Networkservice did the trick :-)


Thanks for the following up.

Kind regards,

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group