{"id":6175,"date":"2017-09-26T13:03:19","date_gmt":"2017-09-26T13:03:19","guid":{"rendered":"https:\/\/kbdeveloper.qoppa.com\/?p=6175"},"modified":"2017-09-26T13:09:25","modified_gmt":"2017-09-26T13:09:25","slug":"6175","status":"publish","type":"post","link":"https:\/\/kbdeveloper.qoppa.com\/6175\/","title":{"rendered":"Excel to PDF Conversion Options"},"content":{"rendered":"<p>When converting an Excel spreadsheet to PDF using jOfficeConvert, there are a few options that can be set through the <a href=\"https:\/\/www.qoppa.com\/files\/officeconvert\/guide\/javadoc\/current\/com\/qoppa\/office\/ExcelConvertOptions.html\">ExcelConvertOptions<\/a> class:<\/p>\n<ul>\n<li>Option to create a bookmark for each worksheet<\/li>\n<li>Option to set the layout of the page (fit to page, width or height)<\/li>\n<li>Option to set a maximum number for the output PDF<\/li>\n<\/ul>\n<p>Here is a sample code showing how to set the Excel conversion options, including information about the options possible values and default value:<\/p>\n<pre lang=\"java\">\r\n\/\/ Create a new Excel conversion options\r\n\/\/ with all default values\r\nExcelConvertOptions options = new ExcelConvertOptions();\r\n\/\/ by default set create bookmarks is on and will create a bookmark for each worksheet\r\n\/\/ using the worksheet name as the bookmark name\r\noptions.setCreateBookmarks(false);\r\n\/\/ this setting is to avoid creating a PDF with too many pages\r\n\/\/ the conversion will stop once the output PDF has reached this max page number\r\n\/\/ by default the max page count is set at 2000\r\noptions.setMaxPageCount(10000);\r\n\/\/ this is the output layout of the PDF based on the Excel worksheet\r\n\/\/ the Paging.ActualSize, Paging.FitToPage, Paging.FitToWidth\r\n\/\/ by default, paging it is set at Page.ActualSize\r\noptions.setPaging(Paging.FitToWidth);\r\n\r\n\/\/ load the Excel document\r\nExcelDocument excelDoc = new ExcelDocument(\"input.xlsx\", options);\r\n \r\n\/\/ save the document as a PDF file\r\nexcelDoc .saveAsPDF(\"output.pdf\");\r\n<\/pre>\n<p>These options are used when opening the Excel file and will also apply when converting the Excel file to images or when sending it to the printer. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>When converting an Excel spreadsheet to PDF using jOfficeConvert, there are a few options that can be set through the ExcelConvertOptions class: Option to create a bookmark for each worksheet Option to set the layout of the page (fit to page, width or height) Option to set a maximum number for the output PDF Here [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[16],"tags":[147,205,209],"_links":{"self":[{"href":"https:\/\/kbdeveloper.qoppa.com\/wp-json\/wp\/v2\/posts\/6175"}],"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=6175"}],"version-history":[{"count":10,"href":"https:\/\/kbdeveloper.qoppa.com\/wp-json\/wp\/v2\/posts\/6175\/revisions"}],"predecessor-version":[{"id":6186,"href":"https:\/\/kbdeveloper.qoppa.com\/wp-json\/wp\/v2\/posts\/6175\/revisions\/6186"}],"wp:attachment":[{"href":"https:\/\/kbdeveloper.qoppa.com\/wp-json\/wp\/v2\/media?parent=6175"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kbdeveloper.qoppa.com\/wp-json\/wp\/v2\/categories?post=6175"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kbdeveloper.qoppa.com\/wp-json\/wp\/v2\/tags?post=6175"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}