ghostscript.net

Can I return byte[] with GhostscriptProcessor?

家住魔仙堡 提交于 2021-02-08 05:45:18
问题 Is it possible to return byte[] using the GhostscriptProcessor? For example: public static byte[] ConvertToPDFA(byte[] pdfData) { GhostscriptProcessor gsproc = new GhostscriptProcessor(Properties.Resources.gsdll32); //return byte[] from the created PDF/A The method StartProcessing is a void method, but is there any alternative thet can create a PDF/A from a PDF File and return a byte[] from its content? 回答1: It's possible: public class PipedOutputSample { public void Start() { string

Replace Specific Document in PDF

做~自己de王妃 提交于 2019-12-24 16:10:04
问题 Includes: using Ghostscript.NET; using Ghostscript.NET.Processor; using Ghostscript.NET.Rasterizer; Right now, I am using Ghostscript.Net to merge several single PDFs into a single document: /// <summary> /// Ghostscripts the file specified in parameter 1 as a PDF to the file specified in parameter 2 /// </summary> /// <param name="fileNames">String[]. Array of Full Paths to a file to convert to a single PDF</param> /// <param name="outputPath">String. Full Path to where Ghostscript will

GhostscriptRasterizer Objects Returns 0 as PageCount value

佐手、 提交于 2019-12-23 12:24:45
问题 txtStatus.Text = ""; if (!File.Exists(txtOpenLocation.Text)) { txtStatus.Text = "File Not Found"; return; } txtStatus.Text = "File Found"; const string DLL_32BITS = "gsdll32.dll"; const string DLL_64BITS = "gsdll64.dll"; //select DLL based on arch string NomeGhostscriptDLL; if (Environment.Is64BitProcess) { NomeGhostscriptDLL = DLL_64BITS; } else { NomeGhostscriptDLL = DLL_32BITS; } GhostscriptVersionInfo gvi = new GhostscriptVersionInfo(NomeGhostscriptDLL); var rasterizer = new

Convert PDF to JPG / Images without using a specific C# Library [closed]

老子叫甜甜 提交于 2019-12-18 11:53:56
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . is there a free C# library ( .dll ) to convert PDF to images ? I tried this one : https://code.google.com/p/lib-pdf/ But it doesn't work, I got this error : Could not load file or assembly 'libpdf.DLL' or one of its dependencies. The specified module could not be found. iTextSharp doesn't implement a function

Ghostscript weird lock on dll (An error occured when call to 'gsapi_new_instance' is made: -100)

末鹿安然 提交于 2019-12-11 08:36:54
问题 I have a C#/MVC website for uploading PDFs and when multiple browser instances try to upload at the same time, using Ghostscript.Net v 1.2.1 , I get the following error: Ghostscript.NET.GhostscriptAPICallException: An error occured when call to 'gsapi_new_instance' is made: -100 at Ghostscript.NET.Interpreter.GhostscriptInterpreter.Initialize() at Ghostscript.NET.Interpreter.GhostscriptInterpreter..ctor(GhostscriptVersionInfo version, Boolean fromMemory) at Ghostscript.NET.Viewer

Ghostscript clips a pdf file

那年仲夏 提交于 2019-12-11 05:56:48
问题 I'm trying to print a pdf with Ghostscript using those settings : var switches = new List<string> { @"-empty", @"-dPrinted", @"-dNOPAUSE", @"-dNOSAFER", @"-dQUIET", @"-dPDFSETTINGS=/printer", @"-dNumCopies=1", @"-sDEVICE=mswinpr2", @"-dCompatibilityLevel=1.4", @"-sOutputFile=%printer%" + printerSettings.PrinterName, @"-f", pdfFileName }; but either the pdf or Ghostscript have bad margins and while it's good when I print it to file it clips when I print it on my printer. Is there any way to

Ghostscript.NET Multithreading Issue

南笙酒味 提交于 2019-12-10 23:07:51
问题 The longest part of a monthly process we run is the automated slicing and conversion of some PDFs to images. Each PDF is read in, converted to 3 different PDFs, and those 3 are converted to images to be placed in e-mails to customers. The PDFs are unique per-customer, and we send a monthly PDF to at least 15,000 (frequently more like 22k) customers. Our PDF generation and slicing is already multithreaded, but I've been looking into parallelizing the remaining bits of it. To that end, I have

GhostscriptLibraryNotInstalledException running under 32-bit process requires native library

旧城冷巷雨未停 提交于 2019-12-10 14:07:29
问题 Using nuget in Visual Studio 2013, I installed Ghostscript.NET into my project on my Windows x64 PC. Just to make sure I wasn't crazy, I checked it: PM> Install-Package Ghostscript.NET 'Ghostscript.NET 1.2.0' already installed. Project already has a reference to 'Ghostscript.NET 1.2.0'. PM> The project is used by multiple developers. It targets Any CPU, and needs to remain that way. Here is my code: public static void GhostscriptNetProcess(String fileName, String outputPath) { var version =

Creating PDF/A with GhostscriptProcessor

南笙酒味 提交于 2019-12-02 06:48:55
问题 I want to convert a PDF file into PDF/A with GhostscriptProcessor, but the result is a PDF not PDF/A. GhostscriptProcessor gsproc = new GhostscriptProcessor(Properties.Resources.gsdll32); gsproc.StartProcessing(CreatePDFA(@"C:\test\PDF.pdf", @"C:\test\PDFA.pdf"), new GsStdio()); And the method: CreateTestArgs(string inputPath, string outputPath) { List<string> gsArgs = new List<string>(); gsArgs.Add("-dPDFA"); gsArgs.Add("-dBATCH"); gsArgs.Add("-dNOPAUSEgsArgs"); gsArgs.Add("-sDEVICE=pdfwrite

Creating PDF/A with GhostscriptProcessor

十年热恋 提交于 2019-12-02 02:02:50
I want to convert a PDF file into PDF/A with GhostscriptProcessor, but the result is a PDF not PDF/A. GhostscriptProcessor gsproc = new GhostscriptProcessor(Properties.Resources.gsdll32); gsproc.StartProcessing(CreatePDFA(@"C:\test\PDF.pdf", @"C:\test\PDFA.pdf"), new GsStdio()); And the method: CreateTestArgs(string inputPath, string outputPath) { List<string> gsArgs = new List<string>(); gsArgs.Add("-dPDFA"); gsArgs.Add("-dBATCH"); gsArgs.Add("-dNOPAUSEgsArgs"); gsArgs.Add("-sDEVICE=pdfwrite"); gsArgs.Add(@"-sOutputFile=" + outputPath); gsArgs.Add(@"-f" + inputPath); return gsArgs.ToArray();