Questions tagged [ghost4j]

Ghost4J is a Java wrapper for the Ghostscript API.

Main features of Ghost4J:

  • Full Ghostscript API supported.
  • Object oriented API.
  • High level API providing a set of components (converters, analyzers, renderers) to handle Postscript and PDF documents.
  • Multi-process support.
42 questions
1
vote
2 answers

Ghost4j produces no output file

I am trying to produce a pdf-output. I finished already the pdf-file with pdfbox, but it has now around 15 MB. This is to large for the planned purpose. So I want to reduce the file size. I tried it first with linux terminal and ghostscript: gs…
1
vote
0 answers

Ghost4j is throwing PDF document is not valid error while converting a pdf to jpg

I have a requirement to convert a pdf file into jpg image. I have written the below code/logic to convert the pdf as per the documentation provided in the below link. http://www.ghost4j.org/highlevelapisamples.html Code: import…
1
vote
1 answer

Is there a Java API that supports validating whether a PDF document be PDF/A or PDF compliant?

I need to supply PDF files to Hylafax Server and server expects PDF to be valid. Is there any java API that supports to validate weather PDF document is PDF/A or PDF compliant? Below are the ways to manually verify the document is valid or…
Bhavesh
  • 519
  • 6
  • 26
1
vote
1 answer

Using Ghost4j to convert PS to PDF in Desktop application java

I'm trying to convert a ps to pdf document and shows me the exception: java.io.IOException: PostScript document is not valid, the code is as follows: FileOutputStream fos = null; PSDocument document = new PSDocument(); File archivoPDFTemp =…
1
vote
1 answer

Getting NoClassDefFoundError: com/sun/jna/win32/StdCallLibrary$StdCallCallback using ghost4j in ubuntu

I am using ghost4j as a jar in my program to convert pdf to image. I am getting Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/jna/win32/StdCallLibrary$StdCallCallback I am new in using ghost4j and I am using Ubuntu…
user3253099
  • 91
  • 2
  • 11
1
vote
0 answers

Ghost4J can't find gs_init.ps

I want to compress a scanned PDF useing ghost4j. While doing that I get following Error First, I am doing some tests if the Files and Directories are available, then starting Initializing Ghost4J: Output: input.pdf is available C:/gs/gs9.15/lib…
1
vote
0 answers

Using Ghost4j to convert PDF to TIF in web application

I am using Ghost4j in a web application to convert PDF to TIFF. While doing performance testing on my application I discovered that when multiple PDF documents need to be converted it takes a long time. After further research I found this part of…
birdy
  • 9,286
  • 24
  • 107
  • 171
1
vote
1 answer

how to use GhostScript to convert a pdf to jpg

It bothered me a whole day afternoon. I encounter many problems and by now i cannot overcome them. my code: public void pdf2jpg(){ try { File pdfFile =new File("c://tmp//1.pdf"); PDFDocument document = new PDFDocument(); …
Ron
  • 553
  • 2
  • 10
  • 30
1
vote
0 answers

Using Ghost4j with MaxProcessCount on a tomcat causes jna error

I'm trying to develop a web-service (based on jersey) which is converting a pdf document into jpeg images. I choosed GhostScript because I have good experiences with it and it's results (especially with embedet fonts). So I searched a way to use…
Gesh
  • 565
  • 1
  • 6
  • 21
0
votes
1 answer

Rendering big Post Script file with Ghost4J in Java

i made a Java application whose purpose is to offer a Print Preview for PS files. My program uses Ghostscript and Ghost4J to load the Post Script file and produces a list of Images (one for each page) using the SimpleRenderer.render method. Then…
Mirai
  • 31
  • 1
  • 4
0
votes
0 answers

ERROR java.lang.UnsatisfiedLinkError: Unable to load library 'gsdll64'

tell me please, I've already broken my whole head ... I have a java maven project, I need to change the RGB color to GRAY for the existing pdf files. Stumbled upon Ghostscript, installed it, tested it via command line, it works. Included in the pom…
Shaldryn
  • 13
  • 1
  • 3
0
votes
0 answers

How to convert a Post Script file to PDF file using java API

Am using below ghost 4j java api to convert the PS file PDF file, Am getting with a pdf file created, but with no data copied from ps file. The error message is as below import java.io.File; import java.io.FileOutputStream; import…
0
votes
1 answer

i have trouble running a postscript file in java, using ghost4j api. btw i have very little knowledge of ghostscript initialization parameters

this is the code that i have copied from ghost4j official site.: BasicConfigurator.configure(); Ghostscript gs = Ghostscript.getInstance(); String[] gsArgs = new String[7]; gsArgs[0] = "-dQUIET"; gsArgs[1] =…
0
votes
0 answers

Ghost4J extract pdf

I want to use ghost4j convert pdf to image. I trying to use PDFDocument.extract to split PDFDcoument and multi thread to convert image. My PDF had some signature content like this picture. (https://i.stack.imgur.com/ydHiE.jpg) I found only the pdf…
Ziv
  • 11
  • 4
0
votes
0 answers

Ghostscript 9.05 unable to convert PDF to PDF using pdfwrite

I am using Ghostscript version Ghostscript 9.05 and converting PDF to PDF using the following parameters: gs -dNOPAUSE -dBATCH -dSAFER -sDEVICE=pdfwrite -sOutputFile=output.pdf -c .setpdfwrite -f input.pdf Exception trace: Processing pages 1…