Quantcast
Channel: Ghostscript.NET
Viewing all 393 articles
Browse latest View live

New Post: Force output to portrait (like a printer device would)

$
0
0
Greetings,

We're converting PDFs to TIFF images for the purposes of fax delivery and looking for best way to essentially behave like a printer -and- orient ALL pages to portrait output. We've read through the many examples of -dAutoRotatePages=/xxx but none of the combinations seem to work using Ghostscript.NET. We noticed an update regarding page rotation and have tried that too (running on latest 1.2).

Ultimately, any params/changes we've made seem to have no effect. Landscape pages do not rotate...

Suggestions?

Thanks.

*** some additional info ***

Added switches to working system: ("-c" seems to cause exception)
switches.Add("-dAutoRotatePages=/None");
switches.Add("-c");
switches.Add("<</Orientation 0>> setpagedevice");
Exception:
"An error occured when call to 'gsapi_init_with_args' is made: -100"

New Post: Convert RGB PDF TO CMYK PDF

$
0
0
Hi,

Can someone help to Convert RGB PDF file to CMYK compliant file ?.

Thank you.

New Post: pdf to pdf-a

$
0
0
Hi,

I have a problem with the transfer pdf to pdf-a
my code:
        string inputFile = @"d:\index.pdf ";
        string outputFile = @"d:\output.pdf ";

        using (GhostscriptProcessor ghostscript = new GhostscriptProcessor())
        {
            ghostscript.Processing += new GhostscriptProcessorProcessingEventHandler(ghostscript_Processing);

            List<string> switches = new List<string>();
            switches.Add("-dPDFA ");
            switches.Add("-dBATCH ");
            switches.Add("-dNOPAUSE ");
            switches.Add("-dNOOUTERSAVE ");
            switches.Add("-dUseCIEColor ");
            switches.Add("-sProcessColorModel=DeviceCMYK");   
            switches.Add("-sDEVICE=pdfwrite");
            switches.Add("-sOutputFile=" + outputFile);
            switches.Add("d:\\PDFA_def.ps");
            switches.Add(inputFile);

            ghostscript.Process(switches.ToArray(), new GsStdio());
        }
Exception:
An exception of type 'Ghostscript.NET.GhostscriptAPICallException' occurred in Ghostscript.NET.dll but was not handled in user code

Additional information: An error occured when call to 'gsapi_init_with_args' is made: -100

Diagnostic debug output:
GS err: GPL Ghostscript
GS err: 9.16
GS err: :
GS err: Unrecoverable error, exit code 1

NuGet Packages:
Ghostscript.NET Version: 1.2.0

GS 9.16

note
When I delete the line:
switches.Add ("d: \ PDFA_def.ps");
program is okay, but output.pdf is not pdf-a valid




thank you for your help

New Post: Deployment Requirements for using Ghostscript.NET managed library

$
0
0
  1. What files do I need to deploy on server to use Ghostscript.NET managed library, apart from just deploying GhostScript.NET.dll file.
  2. Do I need to install Ghostscript on the server?
  3. Do I need gsdll32.dll or gsdll32.lib or gswin32c.exe files to be copied on the server on specific path?

Created Unassigned: Trying to open file in GhostScript rasterizer [2297]

$
0
0
I'm trying to implement your method from here [TEXT](http://ghostscriptnet.codeplex.com/documentation) to allow me to rasterize pdf into collection of images.

When I try to open pdf file

```
_rasterizer.Open(inputPdfPath, _lastInstalledVersion, false);
```

I get this error: __An error occured when call to 'gsapi_init_with_args' is made: -15__

What can be a reason for it. I've checked the file path and it seems to be correct

Thanks

New Post: Trying to open file in GhostScript rasterizer

$
0
0
I'm trying to implement your method from here Rasterize to allow me to rasterize pdf into collection of images.

When I try to open pdf file
_rasterizer.Open(inputPdfPath, _lastInstalledVersion, false);
I get this error: An error occured when call to 'gsapi_init_with_args' is made: -15

What can be a reason for it. I've checked the file path and it seems to be correct

Thanks

New Comment on "Documentation"

$
0
0
I was trying to use GhostscriptRasterizer class as per example above, but line _rasterizer.Open(inputPdfPath, _lastInstalledVersion, false); runs into error: An error occured when call to 'gsapi_init_with_args' is made: -15 Did anyone else experianced that?

Commented Unassigned: Trying to open file in GhostScript rasterizer [2297]

$
0
0
I'm trying to implement your method from here [Rasterize](http://ghostscriptnet.codeplex.com/documentation) to allow me to rasterize pdf into collection of images.

When I try to open pdf file

```
_rasterizer.Open(inputPdfPath, _lastInstalledVersion, false);
```

I get this error: __An error occured when call to 'gsapi_init_with_args' is made: -15__

What can be a reason for it. I've checked the file path and it seems to be correct

Thanks
Comments: ** Comment from web user: bartek4c **

Please ignore, bug in code.


New Post: Trying to open file in GhostScript rasterizer

Updated Wiki: Home

$
0
0

Ghostscript.NET (written in C#) is the most completedmanaged wrapper library around the native Ghostscript library (32-bit & 64-bit), an interpreter for the PostScript language, PDF, related software and documentation.

Source code here is not up-to-date. Latest source code and binaries (v.1.2.0) can be found onGitHubhttps://github.com/jhabjan/Ghostscript.NET

Contains:

  • GhostscriptViewer - View PDF, EPS or multi-page PostScript files on the screen
  • GhostscriptRasterizer - Rasterize PDF, EPS or multi-page PostScript files to any common image format.
  • GhostscriptProcessor - An easy way to call a Ghostscript library with a custom arguments / switches.
  • GhostscriptInterpreter - The PostScript interpreter.

Other features:

  • allows you to rasterize files in memory without storing the output to disk.
  • supports zoom-in and zoom-out.
  • supports progressive update.
  • allows you to run multiple Ghostscript instances simultaneously within a single process.
  • compatible with 32-bit and 64-bit Ghostscript native library.

If you have found Ghostscript.NET useful and has contributed to your project consider donating. Donating helps support Ghostscript.NET.

Click here to lend your support to: Ghostscript.NET and make a donation at pledgie.com !

 

NuGet: PM> Install-Package Ghostscript.NET

 

Used in the Ghostscript Studio (Ghostscript IDE)

                                                       

Samples built on the top of the Ghostscript.NET library:

Ghostscript.NET.Viewer (supports viewing of the PDF, EPS and multi-page PS files)

  Ghostscript.NET.Viewer 

Direct postscript interpretation via Ghostscript.NET.

Cheers,
Josip Habjan
http://habjan.blogspot.com

New Post: Print Pdf Character Encoding

$
0
0
Hi,

I use Ghostscript.Net v1.2.0 for printing pdf files. It prints pdf documents which has only english characters very well but when I try print pdf document which has some turkish characters it doesn't print these characters. Do you have any suggestion for this situation ? My source code shown below;
using (GhostscriptProcessor processor = new GhostscriptProcessor())
                    {
                        List<string> switches = new List<string>();
                        switches.Add("-empty");
                        switches.Add("-dPrinted");
                        switches.Add("-dBATCH");
                        switches.Add("-dNOPAUSE");
                        switches.Add("-dNOSAFER");
                        switches.Add("-dNumCopies="+item.NumberOfCopies);
                        switches.Add("-sDEVICE=mswinpr2");
                        switches.Add("-sOutputFile=%printer%" + item.PrinterName);
                        switches.Add("-f");
                        switches.Add(destFile);
                        processor.StartProcessing(switches.ToArray(), null);
                    }

New Post: Print Pdf Character Encoding

$
0
0
Hi codeFortix,

Can you somehow send me that PDF so I can test it?

You can put it somewhere on the web or send it directly to me: habjan@gmail.com

Cheers,
Josip

New Post: Deployment Requirements for using Ghostscript.NET managed library

New Post: Print Pdf Character Encoding

New Post: Print Pdf Character Encoding

$
0
0
Hi,

The fonts aren't embedded, therefore you get the best guess ghostscript can manage. Especially with non-latin fonts, you must have the original font available to Ghostscript to have a any chance of consistent/correct output. And the best way to manage that is to embed the font in the PDF - as is strongly recommended by the PDF spec.

Cheers,
Josip

New Post: read PDF information

$
0
0
Hi Josip,
Thanks for nice library and help.

I have ps file, and I need to get some information from it, for example customer name, emails, phone number etc.
My fast implementation was just to read ps file and line by line to check it by regular expression for required data.

Do you know if it is possible to use Ghostscript for such tasks or maybe other tools?

Best regards, Taras

New Post: read PDF information

Created Unassigned: not compatible with dotnet 2.0 [2302]

$
0
0
The binary requires the dotnet 4.0 framework runtime to function, System.IO.Pipes usage prevents recompiling as a dotnet 2 dll without modification.

New Post: merge PDF pages into a single PDF

$
0
0
I have a PDF created by Doc1, so it's really several separate documents. I can split it apart just fine into separate pages (e.g., -sOutputPath=\[path]\P-%06d.PDF) but trying to combining subsets of pages is giving me the famous -100 error:
Ghostscript.NET.GhostscriptAPICallException: An error occured when call to 'gsapi_init_with_args' is made: -100
at Ghostscript.NET.Processor.GhostscriptProcessor.StartProcessing(String[] args, GhostscriptStdIO stdIO_callback)
at Ghostscript.NET.Processor.GhostscriptProcessor.Process(String[] args, GhostscriptStdIO stdIO_callback)


The command args are:
  • -sDEVICE=pdfwrite -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -sOutputFile=\\server\path\nnnnnnnnnnnnn.PDF
  • -f\\server\path\P-000001.PDF
  • -f\\server\path\P-000002.PDF
  • -f\\server\path\P-000003.PDF
  • -f\\server\path\P-000004.PDF
I can build this command string and run it fine through GhostScript in a command prompt (gs v.9.16)

Any hints? My GhostscriptVersionInfo object is reporting gs 9.16 just fine

Created Unassigned: GhostscriptRasterizer process dies if feed a bad pdf regardless of try catch [2314]

$
0
0
```
using (var rar = new GhostscriptRasterizer())
{
try
{
//WARNING: this process will fail if its not a real pdf or the pdf is corrupt.
rar.Open(filePath, GetInstalledVersions(GhostscriptLicense.GPL).SingleOrDefault(), true);
var count = rar.PageCount;
//WARNING: this process will fail if its not a real pdf or the pdf is corrupt.
```

I have the above code in a try catch and it still kills the process for my application.

Why does the GhostScript process not just throw an exception, but instead just dies and my try catch is pointless with this.
Viewing all 393 articles
Browse latest View live


Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>