I am using GhostScript.NET to print a PDF. When I print it at 96DPI, the PDF prints fine, but is a little blurry. If I try to print the document at 600DPI, the page that prints extremely magnified.
using GhostScript.NET.Rasterizer;
using System.Drawing.Printing;
PrintDocument doc = new PrintDocument();
doc.PrinterSettings.PrinterName="<printer name>";
doc.PrinterSettings.Copies=(short)1;
GhostScriptRasterizer rasterizer = new GhostScriptRasterizer();
rasterizer.Open("abc.pdf");
//Image page = rasterizer.GetPage(96,96); <-- this one prints ok
Image page = rasterizer.GetPage(600,600);
doc.Graphics.DrawImage(page, new Point());
One thing that I noticed when looking at the page object was that although I passed GetPage() 600, 600 - the image returned had a HorizontalResolution of 96 and a VerticalResolution of 96.
So I tried the following:
Bitmap b = new Bitmap(page.Width,page.Height);
b.SetResolution(600,600);
Graphics g = Graphics.FromImage(b);
g.DrawImage(page,0,0);
page = b;
This has a HorizontalResolution of 600 and VerticalResolution of 600, but this printed the image even larger!
Can anyone give advice here?
hi i got the same Problem.
The Rasterizer only zoom to the dpi...
you have to use the GhostScriptProcessor.