{"id":225,"date":"2013-05-15T08:27:05","date_gmt":"2013-05-14T22:27:05","guid":{"rendered":"http:\/\/www.docx4java.org\/blog\/?p=225"},"modified":"2013-05-15T08:27:05","modified_gmt":"2013-05-14T22:27:05","slug":"docx4jpptxxlsx-online-code-generation","status":"publish","type":"post","link":"https:\/\/www.docx4java.org\/blog\/2013\/05\/docx4jpptxxlsx-online-code-generation\/","title":{"rendered":"docx4j\/pptx\/xlsx online code generation"},"content":{"rendered":"<p>Just launched is <a href=\"http:\/\/webapp.docx4java.org\/\">http:\/\/webapp.docx4java.org<\/a><\/p>\n<p>You should be able to see it in the menu at the top right of this website (if not, reload the web page&#8230;).<\/p>\n<p>There are three things you can do with it right now:<\/p>\n<p>\u2022\u00a0Explore your docx\/pptx\/xlsx and its\u00a0<a href=\"http:\/\/webapp.docx4java.org\/OnlineDemo\/PartsList.html\">representation in docx4j<\/a><\/p>\n<p>\u2022\u00a0Convert \u00a0<a href=\"http:\/\/webapp.docx4java.org\/OnlineDemo\/docx_to_pdf_fop.html\">docx to PDF<\/a> or\u00a0<a href=\"http:\/\/webapp.docx4java.org\/OnlineDemo\/docx_to_xsl_fo.html\">XSL FO<\/a><\/p>\n<p>\u2022\u00a0<a href=\"http:\/\/webapp.docx4java.org\/OnlineDemo\/forms\/upload_MergeDocx.xhtml\">Merge docx files<\/a> (eg cover letter plus contract) into a single docx, using Plutext\u2019s MergeDocx. Or the same thing for pptx files,\u00a0<a href=\"http:\/\/webapp.docx4java.org\/OnlineDemo\/forms\/upload_MergePptx.xhtml\">using MergePptx.<\/a><\/p>\n<p>Here I want to focus on the first of these.<\/p>\n<p>After you&#8217;ve uploaded your docx\/pptx\/xlsx, the first thing you see is like docx4j&#8217;s PartsList sample:<\/p>\n<p><a href=\"http:\/\/www.docx4java.org\/blog\/wp-content\/uploads\/2013\/05\/blog-post.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-226\" title=\"parts list\" src=\"http:\/\/www.docx4java.org\/blog\/wp-content\/uploads\/2013\/05\/blog-post.png\" alt=\"\" width=\"720\" height=\"1040\" srcset=\"https:\/\/www.docx4java.org\/blog\/wp-content\/uploads\/2013\/05\/blog-post.png 720w, https:\/\/www.docx4java.org\/blog\/wp-content\/uploads\/2013\/05\/blog-post-207x300.png 207w, https:\/\/www.docx4java.org\/blog\/wp-content\/uploads\/2013\/05\/blog-post-708x1024.png 708w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/p>\n<p>Here, I&#8217;ll click in the left hand column to look at the main document part, document.xml<\/p>\n<p>When I do that, I see the XML:<\/p>\n<p><a href=\"http:\/\/www.docx4java.org\/blog\/wp-content\/uploads\/2013\/05\/xml.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-227\" title=\"WordML\" src=\"http:\/\/www.docx4java.org\/blog\/wp-content\/uploads\/2013\/05\/xml.png\" alt=\"\" width=\"370\" height=\"492\" srcset=\"https:\/\/www.docx4java.org\/blog\/wp-content\/uploads\/2013\/05\/xml.png 370w, https:\/\/www.docx4java.org\/blog\/wp-content\/uploads\/2013\/05\/xml-225x300.png 225w\" sizes=\"auto, (max-width: 370px) 100vw, 370px\" \/><\/a><\/p>\n<p>No surprises there.<\/p>\n<p>But notice the hyperlinks. \u00a0Here I&#8217;ll just click on the first w:p.<\/p>\n<p>What you get back, is Java source code to create that complete structure:-<\/p>\n<p><a href=\"http:\/\/www.docx4java.org\/blog\/wp-content\/uploads\/2013\/05\/generatedcode1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-229\" title=\"generatedcode\" src=\"http:\/\/www.docx4java.org\/blog\/wp-content\/uploads\/2013\/05\/generatedcode1.png\" alt=\"\" width=\"680\" height=\"851\" srcset=\"https:\/\/www.docx4java.org\/blog\/wp-content\/uploads\/2013\/05\/generatedcode1.png 680w, https:\/\/www.docx4java.org\/blog\/wp-content\/uploads\/2013\/05\/generatedcode1-239x300.png 239w\" sizes=\"auto, (max-width: 680px) 100vw, 680px\" \/><\/a><\/p>\n<p>As you can see from the image above, both styles of code (as described in docx4j&#8217;s Getting Started document) are produced for you. \u00a0With a bit of luck, you can cut\/paste either into your IDE (Eclipse or whatever), and just run with it!<\/p>\n<p>To actually see the created object in an Office document, you&#8217;ll still need to add the created object to a part. \u00a0See Getting Started, or the cheat sheet for how to do that.<\/p>\n<p>I hope this helps you to create\/modify your Office documents more efficiently,with docx4j!<\/p>\n<p>Do let us know what you think in the comments, or in docx4j&#8217;s forums.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Just launched is http:\/\/webapp.docx4java.org You should be able to see it in the menu at the top right of this website (if not, reload the web page&#8230;). There are three things you can do with it right now: \u2022\u00a0Explore your docx\/pptx\/xlsx and its\u00a0representation in docx4j \u2022\u00a0Convert \u00a0docx to PDF or\u00a0XSL FO \u2022\u00a0Merge docx files (eg [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[97,92,96,99,100,74],"tags":[],"class_list":["post-225","post","type-post","status-publish","format-standard","hentry","category-docx","category-docx4j","category-jaxb","category-openxml","category-pptx","category-xlsx"],"_links":{"self":[{"href":"https:\/\/www.docx4java.org\/blog\/wp-json\/wp\/v2\/posts\/225","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.docx4java.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.docx4java.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.docx4java.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.docx4java.org\/blog\/wp-json\/wp\/v2\/comments?post=225"}],"version-history":[{"count":2,"href":"https:\/\/www.docx4java.org\/blog\/wp-json\/wp\/v2\/posts\/225\/revisions"}],"predecessor-version":[{"id":231,"href":"https:\/\/www.docx4java.org\/blog\/wp-json\/wp\/v2\/posts\/225\/revisions\/231"}],"wp:attachment":[{"href":"https:\/\/www.docx4java.org\/blog\/wp-json\/wp\/v2\/media?parent=225"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.docx4java.org\/blog\/wp-json\/wp\/v2\/categories?post=225"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.docx4java.org\/blog\/wp-json\/wp\/v2\/tags?post=225"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}