I'm using this version: "PDFSharp-MigraDocFoundation-1_31" (only the PDFsharp part).
I have a Bitmap in my C# (winforms) application. This bitmap is like a screenshot of the form.
When I save this bitmap to a file (.bmp or .png), it's totally fine. However, when I 'convert' this bitmap into a .pdf file using PDFsharp, the image becomes blurry! (That is, the image on the pdf page of course.)
I zoom in to 100% when viewing the PDF file in Adobe Reader. Also when I print the PDF file, it is blurry on the paper.
(The image/bitmap contains many text objects - therefore it's really easy to see that it's blurry.)
Here is my code:
Bitmap bitmap = new Bitmap(this.Width, this.Height);
this.DrawToBitmap(bitmap, new Rectangle(0, 0, bitmap.Width, bitmap.Height));
PdfDocument doc = new PdfDocument();
PdfPage page = new PdfPage();
XImage img = XImage.FromGdiPlusImage(bitmap);
img.Interpolate = false;
XGraphics xgr = XGraphics.FromPdfPage(doc.Pages);
xgr.DrawImage(img, 0, 0);
I have already searched on the forum regarding this. Found viewtopic.php?p=2471#p2471
but didn't help.
Any help please?