{"id":237,"date":"2014-02-21T09:10:34","date_gmt":"2014-02-21T09:10:34","guid":{"rendered":"http:\/\/test.accura-tech.com\/kbdeveloper\/?p=237"},"modified":"2017-02-23T15:47:15","modified_gmt":"2017-02-23T15:47:15","slug":"code-sample-convert-pdf-to-tiff-in-java","status":"publish","type":"post","link":"https:\/\/kbdeveloper.qoppa.com\/code-sample-convert-pdf-to-tiff-in-java\/","title":{"rendered":"Code Sample: Convert PDF to Tiff in Java"},"content":{"rendered":"<p>This Java program converts a PDF file to a multi-page TIFF file using Qoppa&#8217;s library jPDFProcess.<\/p>\n<pre lang=\"java\">\r\npackage jPDFProcessSamples;\r\nimport java.io.FileOutputStream;\r\nimport com.qoppa.pdf.TIFFOptions;\r\nimport com.qoppa.pdfProcess.PDFDocument;\r\npublic class PDFToTIFF\r\n{\r\n    public static void main (String [] args)\r\n    {\r\n        try\r\n        {\r\n            PDFDocument pdfDoc = new PDFDocument (\"input.pdf\", null);\r\n            TIFFOptions options = new TIFFOptions (150, TIFFOptions.TIFF_PACKBITS);\r\n            FileOutputStream outStream = new FileOutputStream (\"output.tif\");\r\n            pdfDoc.saveDocumentAsTIFF(outStream, options);\r\n            outStream.close();\r\n        }\r\n        catch (Throwable t)\r\n        {\r\n            t.printStackTrace();\r\n        }\r\n    }\r\n}\r\n<\/pre>\n<p><a href=\"\/\/www.qoppa.com\/files\/pdfprocess\/guide\/sourcesamples\/PDFToTIFF.java\" target=\"_blank\">Download sample code.<\/a><\/p>\n<p>jPDFProcess is a powerful PDF library that supports many PDF functions to work with PDF documents in Java. If you&#8217;re only looking to convert PDF documents to Images, please look at our library\u00a0<a href=\"\/\/www.qoppa.com\/pdfimages\/\" target=\"_blank\">jPDFImages<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This Java program converts a PDF file to a multi-page TIFF file using Qoppa&#8217;s library jPDFProcess. package jPDFProcessSamples; import java.io.FileOutputStream; import com.qoppa.pdf.TIFFOptions; import com.qoppa.pdfProcess.PDFDocument; public class PDFToTIFF { public static void main (String [] args) { try { PDFDocument pdfDoc = new PDFDocument (&#8220;input.pdf&#8221;, null); TIFFOptions options = new TIFFOptions (150, TIFFOptions.TIFF_PACKBITS); FileOutputStream outStream = [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[11],"tags":[54,140,147],"_links":{"self":[{"href":"https:\/\/kbdeveloper.qoppa.com\/wp-json\/wp\/v2\/posts\/237"}],"collection":[{"href":"https:\/\/kbdeveloper.qoppa.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kbdeveloper.qoppa.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kbdeveloper.qoppa.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/kbdeveloper.qoppa.com\/wp-json\/wp\/v2\/comments?post=237"}],"version-history":[{"count":4,"href":"https:\/\/kbdeveloper.qoppa.com\/wp-json\/wp\/v2\/posts\/237\/revisions"}],"predecessor-version":[{"id":2745,"href":"https:\/\/kbdeveloper.qoppa.com\/wp-json\/wp\/v2\/posts\/237\/revisions\/2745"}],"wp:attachment":[{"href":"https:\/\/kbdeveloper.qoppa.com\/wp-json\/wp\/v2\/media?parent=237"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kbdeveloper.qoppa.com\/wp-json\/wp\/v2\/categories?post=237"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kbdeveloper.qoppa.com\/wp-json\/wp\/v2\/tags?post=237"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}