|
|
any further ideas?
|
|
|
I think the Problem isn't scaling or the size. The difference is if I have a Image PDF (like a scanned document) than there is no difference to Adobe Acrobat Reader. There is only the difference when we have a vector PDF (like created with word). The Size is calculated like you said. Quote:targetWidth = page.Width / 72.0 * dpi.X; targetHeight = page.Height / 72.0 * dpi.Y; I only add some scaling between 0.5 and 4.0 in steps of 0.1. I compare the output of the rendered Image with Adobe Acrobat with same page size (scale).
|
|
|
Your images has different size. If you scale the Adobe screenshot to size of rendered image, then you will see that there is no any differences.
By the way, how are you calculating targetWidth and targetHeight? If you want to get actual size of the page (to compare it with actual size from AdobeReader) you should use the following formula
targetWidth = page.Width / 72.0 * dpi.X; targetHeight = page.Height / 72.0 * dpi.Y;
where dpi is a current dpi of your desktop.
|
|
|
Hi, I have an issue by rendering pages. If I compare the image rendered by the Code below with the page presented by Adobe Acrobat Reader, there is a huge gap. In Adobe Arcobat Reader the font is slimmer than in the rendered Image. Attached is a sample document, a screenshot from the document opened in Adobe Arcobat Reader and the rendered image. Code:
using (MemoryStream bitmapStream = new MemoryStream())
{
using (var bitmap = new Bitmap(targetWidth, targetHeight))
{
using (var g = Graphics.FromImage(bitmap))
{
g.FillRectangle(new Color.White, 0, 0, targetWidth, targetHeight);
using (var pdfBitmap = new PdfBitmap(targetWidth, targetHeight, true))
{
page.Render(pdfBitmap, 0, 0, targetWidth, targetHeight, PageRotate.Normal, RenderFlags.FPDF_ANNOT);
g.DrawImageUnscaled(pdfBitmap.Image, 0, 0);
}
}
bitmap.Save(bitmapStream, ImageFormat.Bmp);
return bitmapStream.ToArray();
}
}
Do you have any information how I can fix it? Best regards Rendered_Image.bmp (3,305kb) downloaded 34 time(s). Document.pdf (106kb) downloaded 25 time(s). Screenshot_Adobe.bmp (2,204kb) downloaded 29 time(s).
|
Important Information:
The Patagames Software Support Forum uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close