{"id":305120,"date":"2020-06-10T09:00:11","date_gmt":"2020-06-10T09:00:11","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=305120"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=305120","title":{"rendered":"\u0413\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0444\u0430\u0439\u043b\u043e\u0432 Word \u0432 Apache POI"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/503444\/\">\u0414\u043b\u044f \u044f\u0437\u044b\u043a\u0430 Java (\u043a\u0430\u043a, \u0432\u043f\u0440\u043e\u0447\u0435\u043c, \u0438 \u0434\u043b\u044f \u043b\u044e\u0431\u043e\u0433\u043e \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u044f\u0437\u044b\u043a\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f) \u0432\u0441\u0451 \u0435\u0449\u0435 \u043d\u0435 \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u043b\u0438 \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432 docx, \u0447\u0435\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 Apache POI. \u0412 \u043a\u043e\u043d\u0446\u0435 \u043d\u0443\u043b\u0435\u0432\u044b\u0445 \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u0441\u0435\u0439 \u0432\u044b\u0441\u043e\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u044b\u0439 API, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0449\u0438\u0439 \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c \u0441 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c\u044b\u043c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u043c \u043d\u0435 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0438 XML, \u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0443\u0434\u043e\u0431\u043d\u044b\u0445 \u043f\u043e\u043b\u0435\u0439 \u0438 \u0432\u044b\u0432\u043e\u0434\u043e\u0432. <\/p>\n<p>  \u0421\u0443\u0434\u044f \u043f\u043e \u043c\u043e\u0438\u043c Google-\u0437\u0430\u043f\u0440\u043e\u0441\u0430\u043c \u043d\u0430 \u043f\u0440\u043e\u0442\u044f\u0436\u0435\u043d\u0438\u0438 \u0431\u043e\u043b\u0435\u0435 \u0447\u0435\u043c \u0433\u043e\u0434\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u044d\u0442\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043f\u0440\u043e\u0434\u0435\u0440\u0436\u0430\u043b\u043e\u0441\u044c \u0433\u043e\u0434\u0430 \u044d\u0442\u0430\u043a \u0434\u043e 2012, \u0432 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a \u043d\u043e\u0432\u044b\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0432\u0441\u0451 \u0435\u0449\u0435 \u043f\u043e\u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043d\u0430 <a href=\"https:\/\/poi.apache.org\/\" rel=\"nofollow\">\u0433\u043b\u0430\u0432\u043d\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/a>. \u041d\u0435 \u043d\u0430 \u0432\u0441\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b, \u043a\u0430\u0441\u0430\u044e\u0449\u0438\u0435\u0441\u044f \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0430\u043c\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430, \u0435\u0441\u0442\u044c \u043e\u0442\u0432\u0435\u0442\u044b \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0438\u043b\u0438 stackoverflow, \u043d\u0435 \u0433\u043e\u0432\u043e\u0440\u044f \u0443\u0436\u0435 \u043e \u0442\u0435\u043a\u0441\u0442\u0430\u0445 \u043d\u0430 \u0440\u0443\u0441\u0441\u043a\u043e\u043c \u044f\u0437\u044b\u043a\u0435. \u041f\u043e\u0441\u0442\u0430\u0440\u0430\u0435\u043c\u0441\u044f \u043a\u043e\u043c\u043f\u0435\u043d\u0441\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u043a \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u0442\u0435\u0445, \u043a\u043e\u043c\u0443 \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h2>\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b API.<\/h2>\n<p>  <b><a href=\"https:\/\/poi.apache.org\/apidocs\/dev\/org\/apache\/poi\/xwpf\/usermodel\/XWPFDocument.html\" rel=\"nofollow\">XWPFDocument<\/a><\/b> \u2014 \u0446\u0435\u043b\u043e\u0441\u0442\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 Word \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430. \u0412 \u043d\u0451\u043c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f xml-\u043a\u043e\u0434, \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430\u043c\u0438 (Word, LibreOffice), \u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u0441\u044f \u0438 \u043c\u0435\u0442\u043e\u0434\u044b \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0445 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u2014 \u043d\u0430\u0431\u043e\u0440\u0430 \u0441\u0442\u0438\u043b\u0435\u0439, \u0441\u043d\u043e\u0441\u043e\u043a \u0438 \u0442.\u043f. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e \u043f\u0435\u0440\u0432\u043e\u043c, \u0442\u0430\u043a \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043d\u0435 \u0442\u0430\u043a \u044f\u0432\u043d\u043e \u0437\u0430\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0430, \u043a \u0442\u043e\u043c\u0443 \u0436\u0435 \u043c\u043d\u043e\u0433\u0438\u0435 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u044b \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0441\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0441 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435\u043c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430 \u0438 \u0431\u0435\u0437 \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043e\u043a. <\/p>\n<p>  \u0418\u0442\u0430\u043a, \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u0443 \u0432\u0430\u0441 \u043d\u0430 \u0440\u0443\u043a\u0430\u0445 \u0435\u0441\u0442\u044c (\u043d\u0435\u043d\u0443\u0436\u043d\u044b\u0439) \u0444\u0430\u0439\u043b docx. \u041f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u043c \u0435\u0433\u043e \u0432 \u0444\u0430\u0439\u043b zip (\u043e\u0441\u0442\u043e\u0440\u043e\u0436\u043d\u043e, \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0435 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0443\u0442\u0435\u043c \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u044f zip -&gt; docx \u043c\u043e\u0436\u0435\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0444\u0430\u0439\u043b \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u043c \u0434\u043b\u044f \u0432\u0430\u0448\u0435\u0433\u043e \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430(!)), \u0432 \u043f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0435\u043c\u0441\u044f \u0430\u0440\u0445\u0438\u0432\u0435 \u043e\u0442\u043a\u0440\u043e\u0435\u043c \u043f\u0430\u043f\u043a\u0443 word, \u0430 \u0432 \u043d\u0435\u0439 \u2014 \u0444\u0430\u0439\u043b document.xml. \u041f\u0435\u0440\u0435\u0434 \u043d\u0430\u043c\u0438 xml-\u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 word-\u0444\u0430\u0439\u043b\u0430, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0447\u0435\u0440\u0435\u0437 Apache POI, \u0441 \u043c\u0435\u043d\u044c\u0448\u0438\u043c\u0438 \u0442\u0440\u0443\u0434\u043d\u043e\u0441\u0442\u044f\u043c\u0438.<\/p>\n<pre><code class=\"java\">File file = new File(&quot;C:\/username\/document.docx&quot;); FileInputStream fis = new FileInputStream(file.getAbsolutePath()); XWPFDocument document = new XWPFDocument(fis); \/\/ \u0412\u043e\u0442 \u0438 \u043e\u0431\u044a\u0435\u043a\u0442 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0433\u043e \u043d\u0430\u043c\u0438 \u043a\u043b\u0430\u0441\u0441\u0430 String documentLine = document.getDocument().toString();  <\/code><\/pre>\n<p>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0431\u043b\u0438\u0436\u0435 \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u044b\u043c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430, \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0432\u043e\u043e\u0440\u0443\u0436\u0438\u0442\u044c\u0441\u044f \u0435\u0449\u0435 \u0434\u0432\u0443\u043c\u044f \u043a\u043b\u0430\u0441\u0441\u0430\u043c\u0438 API: XWPFParagraph \u0438 XWPFTable. <\/p>\n<p>  <b><a href=\"http:\/\/poi.apache.org\/apidocs\/4.1\/org\/apache\/poi\/xwpf\/usermodel\/XWPFParagraph.html\" rel=\"nofollow\">XWPFParagraph<\/a><\/b> \u2014 \u043a\u0430\u043a \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0438\u0437 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043f\u0430\u0440\u0430\u0433\u0440\u0430\u0444 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430. \u0420\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043a\u0430\u043a \u0432\u043d\u0443\u0442\u0440\u0438 XWPFDocument, <\/p>\n<pre><code class=\"java\">document.getParagraphs(); XWPFParagraph lastParagraph = document.createParagraph();<\/code><\/pre>\n<p> \u0442\u0430\u043a \u0438 \u0432\u043d\u0443\u0442\u0440\u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u044b (\u0435\u0441\u043b\u0438 \u0442\u043e\u0447\u043d\u0435\u0435 \u2014 \u0432\u043d\u0443\u0442\u0440\u0438 \u044f\u0447\u0435\u0439\u043a\u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0439 \u0432 \u0440\u044f\u0434 \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0433\u043e \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443). <\/p>\n<pre><code class=\"java\">document.createTable().createRow().createCell().addParagraph();<\/code><\/pre>\n<p>  \u041f\u0430\u0440\u0430\u0433\u0440\u0430\u0444 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u0437\u0440\u044f\u0434\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u0432\u0451\u0440\u0441\u0442\u043a\u0438 \u0438 \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u0442\u0435\u043a\u0441\u0442\u0430. \u041e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f  \u043d\u0430 \u044d\u0442\u043e\u0442 \u0441\u0447\u0451\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043a\u0440\u0430\u0441\u043d\u043e\u0440\u0435\u0447\u0438\u0432\u0430: \u043e\u0442\u0441\u0442\u0443\u043f\u044b \u0441\u043b\u0435\u0432\u0430 \u0438 \u0441\u043f\u0440\u0430\u0432\u0430, \u0441\u0432\u0435\u0440\u0445\u0443 \u0438 \u0441\u043d\u0438\u0437\u0443, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0438 \u043c\u0435\u0436\u0434\u0443 \u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438, \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0433\u0438\u043f\u0435\u0440\u0441\u0441\u044b\u043b\u043e\u043a \u0438 \u0433\u0440\u0430\u043d\u0438\u0446 \u0434\u043b\u044f \u043f\u0430\u0440\u0430\u0433\u0440\u0430\u0444\u0430.<\/p>\n<p>  <b><a href=\"https:\/\/poi.apache.org\/apidocs\/4.0\/org\/apache\/poi\/xwpf\/usermodel\/XWPFTable.html\" rel=\"nofollow\">XWPFTable<\/a><\/b> \u2014 \u043a\u043b\u0430\u0441\u0441, \u043e\u043b\u0438\u0446\u0435\u0442\u0432\u043e\u0440\u044f\u044e\u0449\u0438\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u0443. \u0422\u0430\u043a\u0436\u0435 \u043a\u0430\u043a \u0438 \u0432 XWPFParagraph, XWPFTable \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043a \u0441\u0430\u043c\u043e\u043c\u0443 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0443 \u0438 \u043a \u044f\u0447\u0435\u0439\u043a\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b (\u0441\u043e\u0437\u0434\u0430\u0432\u0430\u044f, \u0442\u0435\u043c \u0441\u0430\u043c\u044b\u043c, \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0432\u043d\u0443\u0442\u0440\u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u044b). \u0421\u0435\u043c\u0430\u043d\u0442\u0438\u043a\u0430 \u0432 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0447\u0443\u0442\u043e\u0447\u043a\u0443 \u0443\u0441\u043b\u043e\u0436\u043d\u044f\u0435\u0442\u0441\u044f.  <\/p>\n<pre><code class=\"java\">XWPFTable table = document.createTable(); \/\/\u0417\u0434\u0435\u0441\u044c \u0432\u0441\u0451 \u043f\u0440\u043e\u0441\u0442\u043e, \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0435 \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u0441 \u043d\u0435\u0439. XWPFCell cell = table.createRow().createCell();\/\/\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u043a \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u0440\u044f\u0434, \u043a \u0440\u044f\u0434\u0443 - \u044f\u0447\u0435\u0439\u043a\u0443, \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0435\u0451. XWPFTable innerTable = new XWPFTable(cell.getCTTc().addNewTbl(), cell, 2, 2); \/\/ \u0412\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u043e\u043c \u0434\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b - \u0432\u043e\u0437\u044c\u043c\u0435\u043c cell \u0438 \u0435\u0451 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430, \u0430 \u0442\u0430\u043a \u0436\u0435 \u0437\u0430\u0434\u0430\u0434\u0438\u043c \u0447\u0438\u0441\u043b\u043e \u0440\u044f\u0434\u043e\u0432 \u0438 \u043a\u043e\u043b\u043e\u043d\u043e\u043a \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b cell.insertTable(cell.getTables().size(), innerTable); <\/code><\/pre>\n<p>  <a href=\"https:\/\/poi.apache.org\/apidocs\/dev\/org\/apache\/poi\/xwpf\/usermodel\/XWPFRun.html\" rel=\"nofollow\"><b>XWPFRun<\/b><\/a> \u2014 \u043d\u0430\u0431\u043e\u0440 \u0434\u0430\u043d\u043d\u044b\u0445 \u043e \u0432\u044b\u0432\u043e\u0434\u0435 \u0442\u0435\u043a\u0441\u0442\u0430 \u0432\u043d\u0443\u0442\u0440\u0438 \u043f\u0430\u0440\u0430\u0433\u0440\u0430\u0444\u0430. \u041d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043c\u043e\u0436\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u043d\u0443\u0442\u0440\u0438 \u043f\u0430\u0440\u0430\u0433\u0440\u0430\u0444\u0430, \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u0432\u044b\u0437\u043e\u0432 \u043c\u0435\u0442\u043e\u0434\u0430 \u043f\u0430\u0440\u0430\u0433\u0440\u0430\u0444\u0430-\u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044f  <\/p>\n<pre><code class=\"java\">paragraph.createRun(); <\/code><\/pre>\n<p>  \u0418\u0437 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u00ab\u0440\u0430\u043d\u043e\u0432\u00bb, \u043a\u0430\u043a \u044f \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0438\u0442\u0430\u044e \u0438\u0445 \u043d\u0430\u0437\u044b\u0432\u0430\u0442\u044c, \u0438 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0446\u0435\u043b\u044b\u0439 \u043f\u0430\u0440\u0430\u0433\u0440\u0430\u0444 \u0442\u0435\u043a\u0441\u0442\u0430 \u0432 Word. \u041a\u0430\u0436\u0434\u044b\u0439 \u00ab\u0440\u0430\u043d\u00bb \u0438\u043c\u0435\u0435\u0442 \u0441\u0432\u043e\u044e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 \u0448\u0440\u0438\u0444\u0442\u0430, \u0435\u0433\u043e \u0446\u0432\u0435\u0442\u0430 \u0438 \u0440\u0430\u0437\u043c\u0435\u0440\u0430, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0441\u0442\u0438\u043b\u0438\u0437\u0430\u0446\u0438\u0438. \u0427\u0435\u0440\u0435\u0437 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u00ab\u0440\u0430\u043d\u043e\u0432\u00bb, \u043f\u043e\u0434\u0447\u0438\u043d\u044f\u044e\u0449\u0438\u0445\u0441\u044f \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0435 \u043f\u0430\u0440\u0430\u0433\u0440\u0430\u0444\u0430, \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u0442\u0435\u043a\u0441\u0442\u044b \u0441 \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u0440\u0430\u0437\u043d\u043e\u0439 \u0441\u0442\u0438\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439. <\/p>\n<p>  \u041a\u0430\u043a \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0432\u0438\u0434\u043d\u043e \u0438\u0437 \u043e\u0431\u0437\u043e\u0440\u0430 \u043a\u043b\u0430\u0441\u0441\u043e\u0432, \u043f\u0435\u0440\u0435\u043d\u043e\u0441, \u0441\u043a\u0430\u0436\u0435\u043c, css-\u0441\u0442\u0438\u043b\u044f \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442 \u0431\u0443\u0434\u0435\u0442 \u0441\u0432\u044f\u0437\u0430\u043d \u0441 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e: \u0447\u0430\u0441\u0442\u044c \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u043a \u043f\u0430\u0440\u0430\u0433\u0440\u0430\u0444\u0443 docx, \u0447\u0430\u0441\u0442\u044c \u2014 \u043a \u043e\u0431\u044a\u0435\u043a\u0442\u0443 \u043a\u043b\u0430\u0441\u0441\u0430 XWPFRun.<\/p>\n<p>  \u0418\u0442\u0430\u043a, \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043b\u0435\u0433\u043b\u0430 \u0432 External Libraries\/jar \u043b\u0435\u0436\u0438\u0442 \u043f\u043e\u0434 \u0440\u0443\u043a\u043e\u0439, \u043f\u043e\u0440\u0430 \u0442\u0432\u043e\u0440\u0438\u0442\u044c.<br \/>  \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442, \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u0443 2\u04452 \u0438 \u043f\u0430\u0440\u0430\u0433\u0440\u0430\u0444.  <\/p>\n<pre><code class=\"java\">XWPFDocument document = new XWPFDocument(); XWPFTable table = document.createTable(2, 2); XWPFParagraph paragraph = document.createParagraph(); fillTable(table); fillParagraph(paragraph); <\/code><\/pre>\n<p>  \u0417\u0430\u043f\u043e\u043b\u043d\u0438\u043c \u043f\u0430\u0440\u0430\u0433\u0440\u0430\u0444, \u0434\u043e\u0431\u0430\u0432\u0438\u0432 \u0440\u0430\u043d \u0434\u043b\u044f \u0432\u044b\u0432\u043e\u0434\u0430 \u0442\u0435\u043a\u0441\u0442\u0430. \u041f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0430 \u0441\u0442\u0440\u043e\u043a\u0438 \u0441\u0442\u0438\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0430\u0440\u0430\u0433\u0440\u0430\u0444\u0430 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0442\u0435\u0440\u044f\u043d\u0430, \u0438 \u0432 Word \u043d\u043e\u0432\u044b\u0439 \u043f\u0430\u0440\u0430\u0433\u0440\u0430\u0444 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0432\u0435\u0434\u0435\u043d \u0431\u0435\u0437 \u043a\u0440\u0430\u0441\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438.  <\/p>\n<pre><code class=\"java\">void fillParagraph(XWPFParagraph paragraph) {   paragraph.setIndent(20);   XWPFRun run = paragraph.createRun();   run.setFontSize(12);   run.setFontFamily(&quot;Times New Roman&quot;);   run.setText(&quot;My text&quot;);   run.addBreak();   run.setText(&quot;New line&quot;); } <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0437\u0430\u0439\u043c\u0451\u043c\u0441\u044f \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u044b. \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043a \u0443\u0436\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c, \u043d\u043e \u0438 \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0443 \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0440\u044f\u0434\u043e\u0432 \u0438\u043b\u0438 \u043a\u043e\u043b\u043e\u043d\u043e\u043a.  <\/p>\n<pre><code class=\"java\">void fillTable(XWPFTable table) { XWPFRow firstRow = table.getRows().get(0); XWPFRow secondRow = table.getRows().get(1); XWPFRow thirdRow = table.createRow(); fillRow(firstRow); } <\/code><\/pre>\n<p>  \u041e\u043f\u0443\u0441\u043a\u0430\u0435\u043c\u0441\u044f \u0433\u043b\u0443\u0431\u0436\u0435, \u043d\u0430 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0440\u044f\u0434\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u044b. \u0418\u043c\u0435\u043d\u043d\u043e \u0432 \u0442\u0430\u043a\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0451\u0442 \u0440\u0430\u0437\u0431\u043e\u0440 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0432 Apache POI \u2014 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0440\u044f\u0434\u044b, \u043f\u043e\u0442\u043e\u043c \u043a\u043b\u0435\u0442\u043a\u0438. \u041d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043b\u0438\u0448\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043a\u043e\u043b\u043e\u043d\u043e\u043a \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435  <\/p>\n<pre><code class=\"java\">table.getColBandSize(); <\/code><\/pre>\n<p>  \u0418\u0442\u0430\u043a, \u0440\u044f\u0434.   <\/p>\n<pre><code class=\"java\">void fillRow(XWPFRow row) {    List&lt;XWPFTableCell&gt; cellsList = row.getCells();    cellsList.forEach(cell -&gt; fillParagraph(cell.createParagraph())); } <\/code><\/pre>\n<p>  \u041e\u043a\u0430\u0437\u0430\u0432\u0448\u0438\u0441\u044c \u0432 \u044f\u0447\u0435\u0439\u043a\u0435 \u0434\u0432\u0438\u0433\u0430\u0442\u044c\u0441\u044f \u0433\u043b\u0443\u0431\u0436\u0435 \u0443\u0436\u0435 \u043d\u0435\u043a\u0443\u0434\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u0441\u043d\u043e\u0432\u0430 \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u043d\u0430\u0448 \u0434\u0443\u0431\u043e\u043b\u043e\u043c\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u043f\u043e \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044e \u043f\u0430\u0440\u0430\u0433\u0440\u0430\u0444\u0430, \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0432 \u0435\u0433\u043e \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435.<\/p>\n<p>  \u0418\u0442\u0430\u043a, \u043c\u043e\u0436\u043d\u043e \u043b\u0435\u0433\u043a\u043e \u0443\u043b\u043e\u0432\u0438\u0442\u044c \u0441\u0443\u0442\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430 \u0432 Word: \u0432\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0439 \u043e\u0434\u043d\u043e \u0432 \u0434\u0440\u0443\u0433\u043e\u0435 \u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0439 \u0434\u043e\u0441\u0442\u0443\u043f (\u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0438 \u043a \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u043d\u043e\u0432\u044b\u0445 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u043e\u0432). \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0434\u0430\u043b\u0435\u043a\u043e \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0432\u043e \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0439 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438. \u0427\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0442\u0430\u043a\u0438\u043c\u0438 \u0432\u043e\u0442 \u0443\u0445\u0438\u0449\u0440\u0435\u043d\u0438\u044f\u043c\u0438:  <\/p>\n<pre><code class=\"java\">XWPFRun lastRunOfParagraph = paragraph.getRuns(paragraph.getRuns().size() - 1); <\/code><\/pre>\n<p>  \u0425\u043e\u0440\u043e\u0448\u043e, \u0441 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u044b\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c. \u0427\u0442\u043e \u0435\u0441\u043b\u0438 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u044f\u0432\u043d\u043e \u0443\u0442\u043e\u0447\u043d\u0438\u0442\u044c \u0448\u0438\u0440\u0438\u043d\u0443 \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u0430 \u043d\u0435 \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0435\u0451 \u0434\u043b\u044f \u0432\u043e\u043b\u043d\u043e\u0439 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0446\u0438\u0438 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430? <br \/>  \u0414\u043b\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434 \u0447\u0438\u0441\u043b\u043e\u0432\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0448\u0438\u0440\u0438\u043d\u044b \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u0432 Apache POI \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0446\u0435\u043b\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b.  <\/p>\n<pre><code class=\"java\">CTTblWidth widthRepr = table.getCTTbl().getTblPr().addNewTblW(); widthRepr.setType(STTblWidth.DXA); widthRepr.setW(BigInteger.valueOf(4000)); <\/code><\/pre>\n<p>  \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0442\u0438\u043f\u0430 \u0443\u043a\u0430\u0436\u0435\u043c, \u043a\u0430\u043a\u0430\u044f \u0438\u043c\u0435\u043d\u043d\u043e \u0448\u0438\u0440\u0438\u043d\u0430 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u0430: auto, pct \u0438\u043b\u0438 dxa. \u0412 \u043f\u0435\u0440\u0432\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0437\u0430\u0439\u043c\u0451\u0442 \u0432\u0441\u044e \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u0443\u044e \u0435\u0439 \u0448\u0438\u0440\u0438\u043d\u0443, \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u2014 \u043f\u0440\u043e\u0446\u0435\u043d\u0442 \u043e\u0442 \u0432\u0441\u0435\u0439 \u0448\u0438\u0440\u0438\u043d\u044b, \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u0437\u0436\u0435 \u043c\u0435\u0442\u043e\u0434\u043e\u043c setW. \u0412 \u043d\u0430\u0448\u0435\u043c \u0436\u0435 \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u043c\u0435\u0448\u0438\u0432\u0430\u0442\u0435\u0441\u044f \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u0435\u0434\u0438\u043d\u0438\u0446\u0430 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f \u2014 dxa, \u0440\u0430\u0432\u043d\u0430\u044f 1\/20 \u0442\u043e\u0447\u043a\u0438.<br \/>  \u041a\u043b\u0430\u0441\u0441\u044b, \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 CTTblWidth, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u043f\u043e\u0432\u0441\u0435\u043c\u0435\u0441\u0442\u043d\u043e: \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0448\u0438\u0440\u0438\u043d\u044b \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b (PgSize), \u0448\u0438\u0440\u0438\u043d\u044b \u044f\u0447\u0435\u0439\u043a\u0438 \u0438 \u0434\u0440. <\/p>\n<h4>\u0415\u0434\u0438\u043d\u0446\u044b \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f \u0432 Apache POI<\/h4>\n<p>  \u0412 \u0445\u043e\u0440\u043e\u0448\u0435\u043c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0435 \u0432\u0441\u0451 \u0432\u044b\u0432\u0435\u0440\u0435\u043d\u043d\u043e \u0438 \u0440\u0430\u0441\u0447\u0435\u0440\u0447\u0435\u043d\u043e \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e, \u0432\u043f\u043b\u043e\u0442\u044c \u0434\u043e \u0441\u0430\u043c\u043e\u0433\u043e \u043f\u0438\u043a\u0441\u0435\u043b\u044f. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0432 \u0442\u0435\u043e\u0440\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432\u0441\u0451 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438 Apache POI \u0438 \u0431\u0435\u0437 \u0443\u0433\u043b\u0443\u0431\u043b\u0435\u043d\u0438\u044f \u0432 \u0442\u0435\u043c\u0443 \u0435\u0434\u0438\u043d\u0438\u0446 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f, \u043d\u043e \u043b\u0443\u0447\u0448\u0435 \u0443\u0434\u0435\u043b\u0438\u0442\u044c \u0438\u043c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0441\u0440\u0430\u0437\u0443, \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043d\u0435\u0434\u043e\u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0439 \u0432 \u0434\u0443\u0445\u0435 \u00ab\u043f\u043e\u0447\u0435\u043c\u0443 \u044d\u0442\u043e \u0441\u0445\u043b\u043e\u043f\u043d\u0443\u043b\u043e\u0441\u044c\u00bb \u0438 \u00ab\u043a\u043e\u0433\u0434\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u043b \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443 \u0432 word \u043d\u0430 \u043e\u0434\u0438\u043d \u0441\u0430\u043d\u0442\u0438\u043c\u0435\u0442\u0440\u00bb.<\/p>\n<p>  \u041e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0435 \u0441\u0430\u043d\u0442\u0438\u043c\u0435\u0442\u0440\u043e\u0432 \u0438 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0435\u0442\u0440\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0442\u0443\u0442 \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043c\u0435\u0447\u0442\u0430\u0442\u044c. \u042d\u0442\u043e \u0440\u0435\u0437\u043e\u043d\u043d\u043e (\u043a\u0430\u0436\u0434\u044b\u0439 \u0448\u0440\u0438\u0444\u0442 \u0443\u043d\u0438\u043a\u0430\u043b\u0435\u043d, \u0443 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430 \u0441\u0432\u043e\u044f \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430), \u043d\u043e \u0434\u0438\u043a\u043e \u043d\u0435\u0443\u0434\u043e\u0431\u043d\u043e. \u041f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u0431\u0435\u0433\u043d\u0443\u0442\u044c \u043a\u043e \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0443 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u0439, \u0435\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c \u043e\u0442\u0441\u0442\u0443\u043f\u044b (\u0432\u0435\u0434\u044c \u0438\u043c\u0435\u043d\u043d\u043e \u0432 \u0441\u0430\u043d\u0442\u0438\u043c\u0435\u0442\u0440\u0430\u0445 \u043c\u044b \u043f\u0440\u0438\u0432\u044b\u043a\u043b\u0438 \u0432\u0438\u0434\u0435\u0442\u044c \u0438\u0445 \u0432 word) \u0432 \u0441\u0430\u043d\u0442\u0438\u043c\u0435\u0442\u0440\u0430\u0445. \u0418\u0442\u0430\u043a, \u0443\u043a\u0430\u0437\u0430\u0432 \u0442\u0438\u043f \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f dxa \u0434\u043b\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0448\u0438\u0440\u0438\u043d\u044b, \u043a\u0430\u043a \u043e\u043f\u0438\u0441\u043d\u043e \u0432 \u043f\u0430\u0440\u0430\u0433\u0440\u0430\u0444\u0435 \u0432\u044b\u0448\u0435, \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0432 \u0440\u0430\u0441\u043f\u043e\u0440\u044f\u0436\u0435\u043d\u0438\u0435 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0442\u043e\u0447\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u043d\u043e \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u043d\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u043a\u0430\u043a \u0438\u043c \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f. \u0414\u043b\u044f \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0430 \u0432 \u0441\u0430\u043d\u0442\u0438\u043c\u0435\u0442\u0440\u044b \u043d\u0430 stackoverflow \u0435\u0441\u0442\u044c <a href=\"https:\/\/stackoverflow.com\/a\/18708337\" rel=\"nofollow\">\u0444\u043e\u0440\u043c\u0443\u043b\u0430<\/a>. \u0414\u043b\u044f \u0432\u0441\u0435\u0433\u043e \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043a\u043b\u0430\u0441\u0441 <a href=\"https:\/\/poi.apache.org\/apidocs\/dev\/org\/apache\/poi\/util\/Units.html\" rel=\"nofollow\">Units<\/a>. \u0412 \u043d\u0435\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u044b \u043a\u0430\u043a \u043c\u0435\u0442\u043e\u0434\u044b \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0430 \u0435\u0434\u0438\u043d\u0438\u0446 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f, \u0442\u0430\u043a \u0438 \u0441\u0430\u043c\u0438 \u0441\u043e\u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438.<\/p>\n<h4>\u0417\u0430\u043f\u0438\u0441\u044c \u0433\u043e\u0442\u043e\u0432\u043e\u0433\u043e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430<\/h4>\n<p>  \u0414\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u0435\u0441\u0442\u044c \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 XWPFDocument \u2014 write. \u041d\u0430 \u0432\u0445\u043e\u0434 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0442\u043e\u043a, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0439\u0434\u0451\u0442 \u0437\u0430\u043f\u0438\u0441\u044c.  <\/p>\n<pre><code class=\"java\">document.write(new FileOutputStream(new File(&quot;\/path\/to\/file.docx&quot;))); <\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442 \u043d\u0443\u0436\u043d\u043e \u043a\u0443\u0434\u0430-\u0442\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0434\u0430\u0442\u044c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 \u043d\u0435 File-, \u0430 ByteArrayOutputStream.<\/p>\n<h2>\u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e\u0431 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0435 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 xml<\/h2>\n<p>  \u0418\u043c\u0435\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442, \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u044e\u0449\u0438\u0439\u0441\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u043c \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0435, \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0443\u0437\u043d\u0430\u0442\u044c \u043a\u0430\u043a \u0438\u043c\u0435\u043d\u043d\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0439 \u043f\u0430\u0440\u0430\u0433\u0440\u0430\u0444 \u0438\u043b\u0438 \u0434\u0440\u0443\u0433\u043e\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0449\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u043f\u0430\u043a\u0435\u0442\u0430 org.openxmlformats.schemas.wordprocessingml.x2006.main. \u0418\u0437 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f (wordprocessingml) \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438 word. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f xlsx \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0435\u0441\u0442\u044c \u043f\u0430\u043a\u0435\u0442 spreadsheetml, \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043e\u0447\u0435\u043d\u044c \u0438 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u0445\u043e\u0436\u0438 \u043d\u0430 \u043a\u043b\u0430\u0441\u0441\u044b wordprocessingml, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u0444\u043e\u0440\u043c\u0430\u0442\u0430\u043c\u0438 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0437\u0430\u0442\u0440\u0443\u0434\u043d\u0435\u043d\u0430.  <\/p>\n<pre><code class=\"java\">paragraph.getCTP(); table.getCTTbl(); <\/code><\/pre>\n<p>  \u0422\u0430\u043a, \u043f\u0443\u0441\u0442\u043e\u0439 \u043f\u0430\u0440\u0430\u0433\u0440\u0430\u0444 \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0441\u043a\u0440\u043e\u043c\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 <\/p>\n<pre><code class=\"xml\">&lt;xml-fragment\/&gt;<\/code><\/pre>\n<p> \u041f\u0443\u0441\u0442\u0430\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u043f\u043e\u043a\u0430\u0436\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0433\u043e.  <\/p>\n<pre><code class=\"xml\">&lt;xml-fragment xmlns:main=&quot;http:\/\/schemas.openxmlformats.org\/wordprocessingml\/2006\/main&quot;&gt;   &lt;main:tblPr&gt;     &lt;main:tblW main:w=&quot;0&quot; main:type=&quot;auto&quot;\/&gt;     &lt;main:tblBorders&gt;       &lt;main:top main:val=&quot;single&quot;\/&gt;       &lt;main:left main:val=&quot;single&quot;\/&gt;       &lt;main:bottom main:val=&quot;single&quot;\/&gt;       &lt;main:right main:val=&quot;single&quot;\/&gt;       &lt;main:insideH main:val=&quot;single&quot;\/&gt;       &lt;main:insideV main:val=&quot;single&quot;\/&gt;     &lt;\/main:tblBorders&gt;   &lt;\/main:tblPr&gt;   &lt;main:tr&gt;     &lt;main:tc&gt;       &lt;main:p\/&gt;     &lt;\/main:tc&gt;     &lt;main:tc&gt;       &lt;main:p\/&gt;     &lt;\/main:tc&gt;   &lt;\/main:tr&gt;   &lt;main:tr&gt;     &lt;main:tc&gt;       &lt;main:p\/&gt;     &lt;\/main:tc&gt;     &lt;main:tc&gt;       &lt;main:p\/&gt;     &lt;\/main:tc&gt;   &lt;\/main:tr&gt;   &lt;main:tr&gt;     &lt;main:tc&gt;       &lt;main:p\/&gt;     &lt;\/main:tc&gt;     &lt;main:tc&gt;       &lt;main:p\/&gt;     &lt;\/main:tc&gt;   &lt;\/main:tr&gt; &lt;\/xml-fragment&gt;<\/code><\/pre>\n<p>  \u0427\u0442\u043e \u0437\u0434\u0435\u0441\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0433\u043e? \u0421\u0432\u043e\u0439\u0441\u0442\u0432\u0430 tblPr \u2014 \u0432\u0441\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u044b. \u0412\u043d\u0443\u0442\u0440\u0438 \u0443\u0436\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u0430\u044f \u0448\u0438\u0440\u0438\u043d\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u044b (\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0430 0, \u043d\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u00abauto\u00bb \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u0432\u044b\u0432\u0435\u0434\u0435\u0442 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0432 \u043f\u0440\u0438\u0435\u043c\u043b\u0438\u043c\u043e\u0439, \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0448\u0438\u0440\u0438\u043d\u0435). \u0422\u0430\u043a\u0436\u0435 tblBorders \u2014 \u043d\u0430\u0431\u043e\u0440 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u0433\u0440\u0430\u043d\u0438\u0446\u0430\u0445 \u0442\u0430\u0431\u043b\u0438\u0446\u044b. \u0414\u0430\u043b\u0435\u0435 \u0438\u0434\u0451\u0442 \u044f\u0432\u043d\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u043e\u0441\u0442\u0435\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b. tr \u2014 \u0440\u044f\u0434 \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u0432\u043d\u0443\u0442\u0440\u0438 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b tc. \u0412\u043d\u0443\u0442\u0440\u0438 tc \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u0431\u044b \u043d\u0430\u0431\u043e\u0440 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0439 \u043f\u0430\u0440\u0430\u0433\u0440\u0430\u0444\u043e\u0432, \u0435\u0441\u043b\u0438 \u0431\u044b \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u0445\u043e\u0442\u044f \u0431\u044b \u043e\u0434\u0438\u043d. \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043f\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043f\u0430\u0440\u0430\u0433\u0440\u0430\u0444 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439 \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0447\u0442\u043e \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f.  <\/p>\n<pre><code class=\"java\">XWPFParagraph xwpfParagraph = document.getParagraphs().get(0);         xwpfParagraph.setFirstLineIndent(10);         XWPFRun run = xwpfParagraph.createRun();         run.setFontFamily(&quot;Times New Roman&quot;);         run.setText(&quot;New text&quot;);<\/code><\/pre>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c<\/p>\n<pre><code class=\"xml\">&lt;xml-fragment xmlns:main=&quot;http:\/\/schemas.openxmlformats.org\/wordprocessingml\/2006\/main&quot;&gt;   &lt;main:pPr&gt;     &lt;main:ind main:firstLine=&quot;10&quot;\/&gt;   &lt;\/main:pPr&gt;   &lt;main:r&gt;     &lt;main:rPr&gt;       &lt;main:rFonts main:ascii=&quot;Times New Roman&quot; main:hAnsi=&quot;Times New Roman&quot; main:cs=&quot;Times New Roman&quot; main:eastAsia=&quot;Times New Roman&quot;\/&gt;     &lt;\/main:rPr&gt;     &lt;main:t&gt;New text&lt;\/main:t&gt;   &lt;\/main:r&gt; &lt;\/xml-fragment&gt;<\/code><\/pre>\n<p>  \u0417\u0434\u0435\u0441\u044c \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u0440\u043e\u0432\u043d\u043e \u0442\u0430\u043a\u0430\u044f \u0436\u0435: \u043e\u0431\u044a\u0435\u043a\u0442 \u0441 \u043c\u0435\u0442\u0430-\u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439 (\u0432 \u043d\u0435\u0433\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e\u0431 \u043e\u0442\u0441\u0442\u0443\u043f\u0435 \u043a\u0440\u0430\u0441\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0432\u043b\u043e\u0436\u0438\u043b\u0438 \u0432 \u043a\u043e\u0434\u0435), \u0430 \u0442\u0430\u043a \u0436\u0435 \u0441\u0430\u043c\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435: \u0442\u0430\u043c \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u0441\u043f\u0438\u0441\u043e\u043a \u00ab\u0440\u0430\u043d\u043e\u0432\u00bb. \u0412 \u043f\u0435\u0440\u0432\u044b\u0439 \u0438 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u0442\u0435\u043a\u0441\u0442 \u0438 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0448\u0440\u0438\u0444\u0442\u0435. \u042d\u0442\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0442\u0430\u043a\u0436\u0435 \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u043b\u0430\u0441\u044c \u0432\u043d\u0443\u0442\u0440\u0438 \u00ab\u0440\u0430\u043d\u0430\u00bb \u2014 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0448\u0440\u0438\u0444\u0442\u0435 \u043f\u043e\u043f\u0430\u043b\u0430 \u0432 rPr, \u0441\u0430\u043c \u0442\u0435\u043a\u0441\u0442 \u2014 \u0432 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 t.<\/p>\n<h4>\u0412\u043c\u0435\u0441\u0442\u043e \u0432\u044b\u0432\u043e\u0434\u0430<\/h4>\n<p>  Apache POI \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0443\u0434\u043e\u0431\u043d\u044b\u0439, \u0438, \u0447\u0442\u043e \u043d\u0435 \u043c\u0435\u043d\u0435\u0435 \u0432\u0430\u0436\u043d\u043e, \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u0439 API \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438. \u0412 \u043d\u0435\u043c \u043d\u0435\u043f\u0440\u043e\u0441\u0442\u043e \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u0435\u0434\u0438\u043d\u043e\u0433\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432\u043e \u0432\u0441\u0435\u0445 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430\u0445 (Office Online \u0438 LibreOffice \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0438\u043d\u0430\u0447\u0435), \u0435\u0441\u0442\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043d\u0435\u0443\u0434\u043e\u0431\u0441\u0442\u0432 \u0441 \u0435\u0434\u0438\u043d\u0438\u0446\u0430\u043c\u0438 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f, \u0430 \u0442\u0430\u043a \u0436\u0435 \u043d\u0435\u043f\u043e\u043d\u044f\u0442\u043d\u043e \u0433\u0434\u0435 \u0438 \u043a\u0430\u043a\u0438\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0432 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0445 \u0434\u043e\u043b\u0436\u043d\u044b \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f. \u0422\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435, \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u044d\u0442\u0438\u043c\u0438 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438 \u043f\u043e\u0434\u0447\u0438\u043d\u0435\u043d\u0430 \u043b\u043e\u0433\u0438\u043a\u0435, \u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u0434\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0432 xml \u043d\u0435 \u043d\u0430\u0440\u0443\u0448\u0430\u044f \u044d\u0442\u0443 \u043b\u043e\u0433\u0438\u043a\u0443 \u0434\u0435\u043b\u0430\u0435\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0431\u043e\u043b\u0435\u0435 \u0443\u0434\u043e\u0431\u043d\u043e\u0439.<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/503444\/\"> https:\/\/habr.com\/ru\/post\/503444\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/503444\/\">\u0414\u043b\u044f \u044f\u0437\u044b\u043a\u0430 Java (\u043a\u0430\u043a, \u0432\u043f\u0440\u043e\u0447\u0435\u043c, \u0438 \u0434\u043b\u044f \u043b\u044e\u0431\u043e\u0433\u043e \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u044f\u0437\u044b\u043a\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f) \u0432\u0441\u0451 \u0435\u0449\u0435 \u043d\u0435 \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u043b\u0438 \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432 docx, \u0447\u0435\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 Apache POI. \u0412 \u043a\u043e\u043d\u0446\u0435 \u043d\u0443\u043b\u0435\u0432\u044b\u0445 \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u0441\u0435\u0439 \u0432\u044b\u0441\u043e\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u044b\u0439 API, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0449\u0438\u0439 \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c \u0441 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c\u044b\u043c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u043c \u043d\u0435 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0438 XML, \u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0443\u0434\u043e\u0431\u043d\u044b\u0445 \u043f\u043e\u043b\u0435\u0439 \u0438 \u0432\u044b\u0432\u043e\u0434\u043e\u0432. <\/p>\n<p>  \u0421\u0443\u0434\u044f \u043f\u043e \u043c\u043e\u0438\u043c Google-\u0437\u0430\u043f\u0440\u043e\u0441\u0430\u043c \u043d\u0430 \u043f\u0440\u043e\u0442\u044f\u0436\u0435\u043d\u0438\u0438 \u0431\u043e\u043b\u0435\u0435 \u0447\u0435\u043c \u0433\u043e\u0434\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u044d\u0442\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043f\u0440\u043e\u0434\u0435\u0440\u0436\u0430\u043b\u043e\u0441\u044c \u0433\u043e\u0434\u0430 \u044d\u0442\u0430\u043a \u0434\u043e 2012, \u0432 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a \u043d\u043e\u0432\u044b\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0432\u0441\u0451 \u0435\u0449\u0435 \u043f\u043e\u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043d\u0430 <a href=\"https:\/\/poi.apache.org\/\" rel=\"nofollow\">\u0433\u043b\u0430\u0432\u043d\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/a>. \u041d\u0435 \u043d\u0430 \u0432\u0441\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b, \u043a\u0430\u0441\u0430\u044e\u0449\u0438\u0435\u0441\u044f \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0430\u043c\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430, \u0435\u0441\u0442\u044c \u043e\u0442\u0432\u0435\u0442\u044b \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0438\u043b\u0438 stackoverflow, \u043d\u0435 \u0433\u043e\u0432\u043e\u0440\u044f \u0443\u0436\u0435 \u043e \u0442\u0435\u043a\u0441\u0442\u0430\u0445 \u043d\u0430 \u0440\u0443\u0441\u0441\u043a\u043e\u043c \u044f\u0437\u044b\u043a\u0435. \u041f\u043e\u0441\u0442\u0430\u0440\u0430\u0435\u043c\u0441\u044f \u043a\u043e\u043c\u043f\u0435\u043d\u0441\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u043a \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u0442\u0435\u0445, \u043a\u043e\u043c\u0443 \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-305120","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/305120","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=305120"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/305120\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=305120"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=305120"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=305120"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}