Skip to content
This repository has been archived by the owner on Feb 9, 2024. It is now read-only.

Error converting PDF to PDF #61

Open
alexTheSwEngineer opened this issue Nov 27, 2017 · 2 comments
Open

Error converting PDF to PDF #61

alexTheSwEngineer opened this issue Nov 27, 2017 · 2 comments

Comments

@alexTheSwEngineer
Copy link

alexTheSwEngineer commented Nov 27, 2017

I am having an error trying to convert a PDF to a prepress ready PDF.

This code:

private void correctPDF(OutputStream result, PDFDocument pdfDocument){
            PDFConverter converter = new PDFConverter();
            converter.setMaxProcessCount(16);
            converter.setPDFSettings(OPTION_PDFSETTINGS_PREPRESS);
            converter.convert(pdfDocument, result);
}

produces this error:
ERROR: org.ghost4j.converter.ConverterException: org.ghost4j.document.DocumentException: Documents of class org.ghost4j.document.PDFDocument are not supported by the component``

Converting the pdf file to a ps file and then back to pdf seems to be working though.

I have this in my pom

            <groupId>net.java.dev.jna</groupId>
            <artifactId>jna</artifactId>
            <version>4.1.0</version>
        </dependency>

        <dependency>
            <groupId>org.ghost4j</groupId>
            <artifactId>ghost4j</artifactId>
            <version>1.0.1</version>
        </dependency>

and I have instaled ghost* and libgs-dev via apt-get on my system.

@Akash1684
Copy link

I have faced same issue while converting PDF->PDF there are two possible options I've figured out:

  1. Use Core API for converting PDF->PDF http://www.ghost4j.org/coreapisamples.html
  2. Convert using intermediary PostScript document i.e. PDF->PS->PDF

@4F2E4A2E
Copy link
Collaborator

4F2E4A2E commented Oct 9, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants