I'm trying to integrate pdf2img in java code, using java.lang.Runtime.exec()
Runtime run = Runtime.getRuntime();
Process p = null;
try
{
p = run.exec("\"C:\\Program Files\\VeryPDF PDF2Image v2.1\\pdf2img.exe\" -m -i C:\\test.pdf -o C:\\test.pdf.tif");
int salida = p.waitFor();
System.out.println("exitValue: " + salida);
}
catch (Exception e)
{
e.printStackTrace();
}
It seems to work; i get the tiff output and an exit value of 0 (By convention, 0 indicates normal termination)
But! - if I provoke an error - specifying a non exitsting directory, I also get exit value 0 (and an empty tiff-file.!)
I have also invoked VeryDOCÂ doc2any the same way, and it returns 1 meening succes and 0 when an error occurred.
Can you help me how to detect errors using pdf2img?
==================================
We apologize for any inconvenience this may have caused to you, maybe this is a problem in the current version of pdf2img.exe application , we will research this problem shortly.
Additionally, I suggest you may simple check the input PDF file before you deliver it to pdf2img.exe application, if input PDF file is not exist, you needn’t call pdf2img.exe application for conversion, this can be done easily, is this solution okay to you?
VeryPDF
VN:F [1.9.20_1166]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.20_1166]
Related Posts
- pdf2image converts PDF files into high-quality JPEG, GIF, PNG, TIFF and BMP images for publishing on websites or for use in applications
- Transform PDF, EPS, and AI files into editable vector drawings or high-fidelity image formats
- Relieving Document Headaches in Healthcare Field with VeryPDF ISO-Compliant Document Processing
- Automate Your Document Processes with VeryPDF Document Conversion Service
- VeryPDF jPDFProcess Java Library: Create and Manipulate PDF Documents with Ease
- Powerful VeryPDF PDF Conversion SDK for Developers: Convert PDF, Word, Excel, PowerPoint, HTML, and More!
- Intelligent PDF Data Extraction with VeryPDF Data Extraction SDK: JSON Output, Table Extraction, and More
- Convert PDF to Text with VeryPDF PDF to Text SDK for Windows, Linux, Mac, iOS, Android platforms
- How to add text stamps to PDF pages and convert PDF pages to image files with PDF Editor OCX product?
- VeryPDF PDF SDK for Web & Windows & Linux & Mac & iOS & Android as well as PDF Conversion SDK
- Call PDF To Image Converter COM Component v2.0 from 64bit application
- How to call PDF to Image Converter from SaaS (- Software as as Service) platform?
- Convert Korean characters from PDF file to BMP image?
- How could we convert Uzbekistan pdf to bmp clearly?
- How to convert from a color or grayscale PDF file to black and white TIFF or PDF file?