Tag: ghostscript.net

使用GhostscriptProcessor创建PDF / A.

我想使用GhostscriptProcessor将PDF文件转换为PDF / A,但结果是PDF而不是PDF / A. GhostscriptProcessor gsproc = new GhostscriptProcessor(Properties.Resources.gsdll32); gsproc.StartProcessing(CreatePDFA(@”C:\test\PDF.pdf”, @”C:\test\PDFA.pdf”), new GsStdio()); 方法: CreateTestArgs(string inputPath, string outputPath) { List gsArgs = new List(); gsArgs.Add(“-dPDFA”); gsArgs.Add(“-dBATCH”); gsArgs.Add(“-dNOPAUSEgsArgs”); gsArgs.Add(“-sDEVICE=pdfwrite”); gsArgs.Add(@”-sOutputFile=” + outputPath); gsArgs.Add(@”-f” + inputPath); return gsArgs.ToArray(); } 如果我从命令行使用gswin32.exe,结果是PDF / A文件。

使用GhostScript.NET DPI打印问题打印PDF

我正在使用GhostScript.NET来打印PDF。 当我以96DPI打印时,PDF打印很好,但有点模糊。 如果我尝试以600DPI打印文档,则打印的页面会非常放大。 using GhostScript.NET.Rasterizer; using System.Drawing.Printing; PrintDocument doc = new PrintDocument(); doc.PrinterSettings.PrinterName=””; 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()); 我在注意页面对象时注意到的一件事是,尽管我传递了GetPage()600,600,但返回的图像的Horizo​​ntalResolution为96,VerticalResolution为96。 所以我尝试了以下内容: Bitmap b = new Bitmap(page.Width,page.Height); b.SetResolution(600,600); Graphics g = Graphics.FromImage(b); g.DrawImage(page,0,0); page = b; 它的Horizo​​ntalResolution为600,VerticalResolution为600,但这样打印的图像更大! 谁能在这里给出建议?

在不使用特定C#库的情况下将PDF转换为JPG /图像

是否有免费的C#库 ( .dll )将PDF转换为图像 ? 我尝试过这个: https://code.google.com/p/lib-pdf/ 但它没有用,我收到了这个错误: Could not load file or assembly ‘libpdf.DLL’ or one of its dependencies. The specified module could not be found. iTextSharp没有实现这样的function.. 编辑: 我没有使用ghost scrpit,因为你必须先在计算机上安装它 但现在我找到了一个解决方案:如果你加载manualy它的工作原理 http://sofzh.miximages.com/c%23/ rasterizer.Open(file, vesion, false); for (int i = 1; i = rasterizer.PageCount; i++) { string pageFilePath = Path.Combine(outputPath, Path.GetFileNameWithoutExtension(file) + -p + i.ToString() […]