Page 1 of 1
adding multiple lines of text to title
Posted:
Wed Feb 19, 2014 8:05 pm
by yurylankovskiy
Is it possible to add multiple lines of text to title?
I have tried something like this but it doesn't seem to work ...
- Code: Select all
wordMLPackage.getMainDocumentPart().addStyledParagraphOfText("Title", "Hello Word!" + "\n" + "Try This!" + "\t\t\t\t\t\taa");
Re: adding multiple lines of text to title
Posted:
Wed Feb 19, 2014 8:57 pm
by jason
You'll have to use the lower level API.
If you upload a sample docx to the webapp linked in the menu above, you'll be able to generate something like the following:
Using xml Syntax Highlighting
<w:p>
<w:pPr>
<w:pStyle w:val="Title"/>
</w:pPr>
<w:r>
<w:t>Hello Word!
</w:t>
<w:br/>
<w:t>Try This!
</w:t>
<w:tab/>
<w:tab/>
<w:tab/>
<w:tab/>
<w:tab/>
<w:tab/>
<w:t>aa
</w:t>
</w:r>
</w:p>
Parsed in 0.001 seconds, using
GeSHi 1.0.8.4
Method 1: via ObjectFactory
Using java Syntax Highlighting
import javax.xml.bind.JAXBElement;
import org.docx4j.wml.Br;
import org.docx4j.wml.P;
import org.docx4j.wml.PPr;
import org.docx4j.wml.PPrBase;
import org.docx4j.wml.PPrBase.PStyle;
import org.docx4j.wml.R;
import org.docx4j.wml.R.Tab;
import org.docx4j.wml.Text;
public class Foo
{
public P createIt
() {
org.
docx4j.
wml.
ObjectFactory wmlObjectFactory
= new org.
docx4j.
wml.
ObjectFactory();
P p
= wmlObjectFactory.
createP();
// Create object for pPr
PPr ppr
= wmlObjectFactory.
createPPr();
p.
setPPr(ppr
);
// Create object for pStyle
PPrBase.
PStyle pprbasepstyle
= wmlObjectFactory.
createPPrBasePStyle();
ppr.
setPStyle(pprbasepstyle
);
pprbasepstyle.
setVal( "Title");
// Create object for r
R r
= wmlObjectFactory.
createR();
p.
getContent().
add( r
);
// Create object for t (wrapped in JAXBElement)
Text text
= wmlObjectFactory.
createText();
JAXBElement
<org.
docx4j.
wml.
Text> textWrapped
= wmlObjectFactory.
createRT(text
);
r.
getContent().
add( textWrapped
);
text.
setValue( "Hello Word!");
// Create object for br
Br br
= wmlObjectFactory.
createBr();
r.
getContent().
add( br
);
// Create object for t (wrapped in JAXBElement)
Text text2
= wmlObjectFactory.
createText();
JAXBElement
<org.
docx4j.
wml.
Text> textWrapped2
= wmlObjectFactory.
createRT(text2
);
r.
getContent().
add( textWrapped2
);
text2.
setValue( "Try This!");
// Create object for tab (wrapped in JAXBElement)
R.
Tab rtab
= wmlObjectFactory.
createRTab();
JAXBElement
<org.
docx4j.
wml.
R.
Tab> rtabWrapped
= wmlObjectFactory.
createRTab(rtab
);
r.
getContent().
add( rtabWrapped
);
// Create object for tab (wrapped in JAXBElement)
R.
Tab rtab2
= wmlObjectFactory.
createRTab();
JAXBElement
<org.
docx4j.
wml.
R.
Tab> rtabWrapped2
= wmlObjectFactory.
createRTab(rtab2
);
r.
getContent().
add( rtabWrapped2
);
// Create object for tab (wrapped in JAXBElement)
R.
Tab rtab3
= wmlObjectFactory.
createRTab();
JAXBElement
<org.
docx4j.
wml.
R.
Tab> rtabWrapped3
= wmlObjectFactory.
createRTab(rtab3
);
r.
getContent().
add( rtabWrapped3
);
// Create object for tab (wrapped in JAXBElement)
R.
Tab rtab4
= wmlObjectFactory.
createRTab();
JAXBElement
<org.
docx4j.
wml.
R.
Tab> rtabWrapped4
= wmlObjectFactory.
createRTab(rtab4
);
r.
getContent().
add( rtabWrapped4
);
// Create object for tab (wrapped in JAXBElement)
R.
Tab rtab5
= wmlObjectFactory.
createRTab();
JAXBElement
<org.
docx4j.
wml.
R.
Tab> rtabWrapped5
= wmlObjectFactory.
createRTab(rtab5
);
r.
getContent().
add( rtabWrapped5
);
// Create object for tab (wrapped in JAXBElement)
R.
Tab rtab6
= wmlObjectFactory.
createRTab();
JAXBElement
<org.
docx4j.
wml.
R.
Tab> rtabWrapped6
= wmlObjectFactory.
createRTab(rtab6
);
r.
getContent().
add( rtabWrapped6
);
// Create object for t (wrapped in JAXBElement)
Text text3
= wmlObjectFactory.
createText();
JAXBElement
<org.
docx4j.
wml.
Text> textWrapped3
= wmlObjectFactory.
createRT(text3
);
r.
getContent().
add( textWrapped3
);
text3.
setValue( "aa");
return p
;
}
}
Parsed in 0.021 seconds, using
GeSHi 1.0.8.4
Method 2
Using java Syntax Highlighting
String openXML
= "<w:p xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\">
+ "<w
:pPr
>
+ "<w:pStyle w:val=\"Title\"/>"
+"</w:pPr>"
+ "<w:r>
+ "<w
:t
>Hello Word
!</w
:t
>"
+ "<w
:br
/>"
+ "<w
:t
>Try
This!</w
:t
>"
+ "<w
:tab
/>"
+ "<w
:tab
/>"
+ "<w
:tab
/>"
+ "<w
:tab
/>"
+ "<w
:tab
/>"
+ "<w
:tab
/>"
+ "<w
:t
>aa
</w
:t
>"
+"</w
:r
>"
+"</w
:p
>";
P p = (P)XmlUtils.unmarshalString(openXML);
Parsed in 0.016 seconds, using
GeSHi 1.0.8.4
Re: adding multiple lines of text to title
Posted:
Thu Feb 20, 2014 4:25 pm
by yurylankovskiy
jason wrote:You'll have to use the lower level API.
If you upload a sample docx to the webapp linked in the menu above, you'll be able to generate something like the following:
Using xml Syntax Highlighting
<w:p>
<w:pPr>
<w:pStyle w:val="Title"/>
</w:pPr>
<w:r>
<w:t>Hello Word!
</w:t>
<w:br/>
<w:t>Try This!
</w:t>
<w:tab/>
<w:tab/>
<w:tab/>
<w:tab/>
<w:tab/>
<w:tab/>
<w:t>aa
</w:t>
</w:r>
</w:p>
Parsed in 0.001 seconds, using
GeSHi 1.0.8.4
Method 1: via ObjectFactory
Using java Syntax Highlighting
import javax.xml.bind.JAXBElement;
import org.docx4j.wml.Br;
import org.docx4j.wml.P;
import org.docx4j.wml.PPr;
import org.docx4j.wml.PPrBase;
import org.docx4j.wml.PPrBase.PStyle;
import org.docx4j.wml.R;
import org.docx4j.wml.R.Tab;
import org.docx4j.wml.Text;
public class Foo
{
public P createIt
() {
org.
docx4j.
wml.
ObjectFactory wmlObjectFactory
= new org.
docx4j.
wml.
ObjectFactory();
P p
= wmlObjectFactory.
createP();
// Create object for pPr
PPr ppr
= wmlObjectFactory.
createPPr();
p.
setPPr(ppr
);
// Create object for pStyle
PPrBase.
PStyle pprbasepstyle
= wmlObjectFactory.
createPPrBasePStyle();
ppr.
setPStyle(pprbasepstyle
);
pprbasepstyle.
setVal( "Title");
// Create object for r
R r
= wmlObjectFactory.
createR();
p.
getContent().
add( r
);
// Create object for t (wrapped in JAXBElement)
Text text
= wmlObjectFactory.
createText();
JAXBElement
<org.
docx4j.
wml.
Text> textWrapped
= wmlObjectFactory.
createRT(text
);
r.
getContent().
add( textWrapped
);
text.
setValue( "Hello Word!");
// Create object for br
Br br
= wmlObjectFactory.
createBr();
r.
getContent().
add( br
);
// Create object for t (wrapped in JAXBElement)
Text text2
= wmlObjectFactory.
createText();
JAXBElement
<org.
docx4j.
wml.
Text> textWrapped2
= wmlObjectFactory.
createRT(text2
);
r.
getContent().
add( textWrapped2
);
text2.
setValue( "Try This!");
// Create object for tab (wrapped in JAXBElement)
R.
Tab rtab
= wmlObjectFactory.
createRTab();
JAXBElement
<org.
docx4j.
wml.
R.
Tab> rtabWrapped
= wmlObjectFactory.
createRTab(rtab
);
r.
getContent().
add( rtabWrapped
);
// Create object for tab (wrapped in JAXBElement)
R.
Tab rtab2
= wmlObjectFactory.
createRTab();
JAXBElement
<org.
docx4j.
wml.
R.
Tab> rtabWrapped2
= wmlObjectFactory.
createRTab(rtab2
);
r.
getContent().
add( rtabWrapped2
);
// Create object for tab (wrapped in JAXBElement)
R.
Tab rtab3
= wmlObjectFactory.
createRTab();
JAXBElement
<org.
docx4j.
wml.
R.
Tab> rtabWrapped3
= wmlObjectFactory.
createRTab(rtab3
);
r.
getContent().
add( rtabWrapped3
);
// Create object for tab (wrapped in JAXBElement)
R.
Tab rtab4
= wmlObjectFactory.
createRTab();
JAXBElement
<org.
docx4j.
wml.
R.
Tab> rtabWrapped4
= wmlObjectFactory.
createRTab(rtab4
);
r.
getContent().
add( rtabWrapped4
);
// Create object for tab (wrapped in JAXBElement)
R.
Tab rtab5
= wmlObjectFactory.
createRTab();
JAXBElement
<org.
docx4j.
wml.
R.
Tab> rtabWrapped5
= wmlObjectFactory.
createRTab(rtab5
);
r.
getContent().
add( rtabWrapped5
);
// Create object for tab (wrapped in JAXBElement)
R.
Tab rtab6
= wmlObjectFactory.
createRTab();
JAXBElement
<org.
docx4j.
wml.
R.
Tab> rtabWrapped6
= wmlObjectFactory.
createRTab(rtab6
);
r.
getContent().
add( rtabWrapped6
);
// Create object for t (wrapped in JAXBElement)
Text text3
= wmlObjectFactory.
createText();
JAXBElement
<org.
docx4j.
wml.
Text> textWrapped3
= wmlObjectFactory.
createRT(text3
);
r.
getContent().
add( textWrapped3
);
text3.
setValue( "aa");
return p
;
}
}
Parsed in 0.021 seconds, using
GeSHi 1.0.8.4
Method 2
Using java Syntax Highlighting
String openXML
= "<w:p xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\">
+ "<w
:pPr
>
+ "<w:pStyle w:val=\"Title\"/>"
+"</w:pPr>"
+ "<w:r>
+ "<w
:t
>Hello Word
!</w
:t
>"
+ "<w
:br
/>"
+ "<w
:t
>Try
This!</w
:t
>"
+ "<w
:tab
/>"
+ "<w
:tab
/>"
+ "<w
:tab
/>"
+ "<w
:tab
/>"
+ "<w
:tab
/>"
+ "<w
:tab
/>"
+ "<w
:t
>aa
</w
:t
>"
+"</w
:r
>"
+"</w
:p
>";
P p = (P)XmlUtils.unmarshalString(openXML);
Parsed in 0.015 seconds, using
GeSHi 1.0.8.4
Thanks for the reply. Is there a dynamic way of creating this?
Re: adding multiple lines of text to title
Posted:
Thu Feb 20, 2014 7:02 pm
by jason
yurylankovskiy wrote:Is there a dynamic way of creating this?
Sorry, I don't understand what you mean?
I said You'll have to use the lower level API.
Re: adding multiple lines of text to title
Posted:
Thu Feb 20, 2014 7:47 pm
by yurylankovskiy
Okay ...
Is there a way to insert image to the document together with text? I have used webapp to generate the code but I get error saying: the prefix "w" for element w:document is not bound. I have tried researching but there's not much on this issue.
Re: adding multiple lines of text to title
Posted:
Thu Feb 20, 2014 8:21 pm
by jason
yurylankovskiy wrote:the prefix "w" for element w:document is not bound
When unmarshalling a string, you need to declare all the namespaces (as in the example earlier in the thread). ie xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
Re: adding multiple lines of text to title
Posted:
Thu Feb 20, 2014 9:00 pm
by yurylankovskiy
jason wrote:yurylankovskiy wrote:the prefix "w" for element w:document is not bound
When unmarshalling a string, you need to declare all the namespaces (as in the example earlier in the thread). ie xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
Okay, did that and now it generates the paragraph but when I try to open the doc file it gives an error.
Here's my doc form webapp, I don't understand how shall I import the image into the document ...
- Code: Select all
<w:document mc:Ignorable="w14 wp14">
<w:body>
<w:p>
<w:pPr>
<w:spacing w:after="0" w:line="240" w:lineRule="auto"/>
<w:ind w:left="1560"/>
<w:jc w:val="both"/>
<w:rPr>
<w:rFonts w:cs="Tahoma"/>
<w:b/>
<w:sz w:val="28"/>
<w:szCs w:val="28"/>
</w:rPr>
</w:pPr>
<w:r>
<w:rPr>
<w:noProof/>
</w:rPr>
<w:drawing>
<wp:anchor distT="0" distB="0" distL="114300" distR="114300" simplePos="false" relativeHeight="251657216" behindDoc="false" locked="false" layoutInCell="true" allowOverlap="true">
<wp:simplePos x="0" y="0"/>
<wp:positionH relativeFrom="column">
<wp:posOffset>-95885</wp:posOffset>
</wp:positionH>
<wp:positionV relativeFrom="paragraph">
<wp:posOffset>36830</wp:posOffset>
</wp:positionV>
<wp:extent cx="824865" cy="1154430"/>
<wp:effectExtent l="0" t="0" r="0" b="0"/>
<wp:wrapSquare wrapText="bothSides"/>
<wp:docPr id="4" name="Picture 4" descr="лого трава big"/>
<wp:cNvGraphicFramePr>
<a:graphicFrameLocks noChangeAspect="true"/>
</wp:cNvGraphicFramePr>
<a:graphic>
<a:graphicData uri="http://schemas.openxmlformats.org/drawingml/2006/picture">
<pic:pic>
<pic:nvPicPr>
<pic:cNvPr id="0" name="Picture 4" descr="лого трава big"/>
<pic:cNvPicPr>
<a:picLocks noChangeAspect="true" noChangeArrowheads="true"/>
</pic:cNvPicPr>
</pic:nvPicPr>
<pic:blipFill>
<a:blip cstate="print" r:embed="rId7">
<a:extLst>
<a:ext uri="{28A0092B-C50C-407E-A947-70E740481C1C}">
<a14:useLocalDpi val="0"/>
</a:ext>
</a:extLst>
</a:blip>
<a:srcRect/>
<a:stretch>
<a:fillRect/>
</a:stretch>
</pic:blipFill>
<pic:spPr bwMode="auto">
<a:xfrm>
<a:off x="0" y="0"/>
<a:ext cx="824865" cy="1154430"/>
</a:xfrm>
<a:prstGeom prst="rect">
<a:avLst/>
</a:prstGeom>
<a:noFill/>
<a:ln>
<a:noFill/>
</a:ln>
</pic:spPr>
</pic:pic>
</a:graphicData>
</a:graphic>
</wp:anchor>
</w:drawing>
</w:r>
<w:r>
<w:rPr>
<w:rFonts w:cs="Tahoma"/>
<w:b/>
<w:sz w:val="28"/>
<w:szCs w:val="28"/>
</w:rPr>
<w:t>ООО «ИнтерПол»</w:t>
</w:r>
</w:p>
<w:p>
<w:pPr>
<w:spacing w:after="0" w:line="240" w:lineRule="auto"/>
<w:ind w:left="1560"/>
<w:jc w:val="both"/>
<w:rPr>
<w:rFonts w:cs="Tahoma"/>
<w:b/>
<w:sz w:val="20"/>
<w:szCs w:val="20"/>
</w:rPr>
</w:pPr>
<w:r>
<w:rPr>
<w:rFonts w:cs="Tahoma"/>
<w:b/>
<w:sz w:val="20"/>
<w:szCs w:val="20"/>
</w:rPr>
<w:t>6300</w:t>
</w:r>
<w:r>
<w:rPr>
<w:rFonts w:cs="Tahoma"/>
<w:b/>
<w:sz w:val="20"/>
<w:szCs w:val="20"/>
</w:rPr>
<w:t>0</w:t>
</w:r>
<w:r>
<w:rPr>
<w:rFonts w:cs="Tahoma"/>
<w:b/>
<w:sz w:val="20"/>
<w:szCs w:val="20"/>
</w:rPr>
<w:t xml:space="preserve">1, Новосибирская область, г. Новосибирск, ул. </w:t>
</w:r>
<w:r>
<w:rPr>
<w:rFonts w:cs="Tahoma"/>
<w:b/>
<w:sz w:val="20"/>
<w:szCs w:val="20"/>
</w:rPr>
<w:t>Сухарная, д.35, корп.4, офис 406</w:t>
</w:r>
</w:p>
<w:p>
<w:pPr>
<w:spacing w:after="0" w:line="240" w:lineRule="auto"/>
<w:ind w:left="1560"/>
<w:jc w:val="both"/>
<w:rPr>
<w:rFonts w:cs="Tahoma"/>
<w:b/>
<w:sz w:val="20"/>
<w:szCs w:val="20"/>
</w:rPr>
</w:pPr>
<w:r>
<w:rPr>
<w:rFonts w:cs="Tahoma"/>
<w:b/>
<w:sz w:val="20"/>
<w:szCs w:val="20"/>
</w:rPr>
<w:t>Тел</w:t>
</w:r>
<w:r>
<w:rPr>
<w:rFonts w:cs="Tahoma"/>
<w:b/>
<w:sz w:val="20"/>
<w:szCs w:val="20"/>
</w:rPr>
<w:t>. (383) 3</w:t>
</w:r>
<w:r>
<w:rPr>
<w:rFonts w:cs="Tahoma"/>
<w:b/>
<w:sz w:val="20"/>
<w:szCs w:val="20"/>
</w:rPr>
<w:t>75-70-35</w:t>
</w:r>
<w:r>
<w:rPr>
<w:rFonts w:cs="Tahoma"/>
<w:b/>
<w:sz w:val="20"/>
<w:szCs w:val="20"/>
</w:rPr>
<w:t>, 8-909-529-5</w:t>
</w:r>
<w:r>
<w:rPr>
<w:rFonts w:cs="Tahoma"/>
<w:b/>
<w:sz w:val="20"/>
<w:szCs w:val="20"/>
</w:rPr>
<w:t>7-57</w:t>
</w:r>
</w:p>
<w:p>
<w:pPr>
<w:spacing w:after="0" w:line="240" w:lineRule="auto"/>
<w:ind w:left="1560"/>
<w:jc w:val="both"/>
<w:rPr>
<w:rFonts w:cs="Tahoma"/>
<w:b/>
<w:sz w:val="20"/>
<w:szCs w:val="20"/>
<w:lang w:val="en-US"/>
</w:rPr>
</w:pPr>
<w:proofErr w:type="gramStart"/>
<w:r>
<w:rPr>
<w:rFonts w:cs="Tahoma"/>
<w:b/>
<w:sz w:val="20"/>
<w:szCs w:val="20"/>
<w:lang w:val="en-US"/>
</w:rPr>
<w:t>e-mail</w:t>
</w:r>
<w:proofErr w:type="gramEnd"/>
<w:r>
<w:rPr>
<w:rFonts w:cs="Tahoma"/>
<w:b/>
<w:sz w:val="20"/>
<w:szCs w:val="20"/>
<w:lang w:val="en-US"/>
</w:rPr>
<w:t>: info@interpol-nsk.ru</w:t>
</w:r>
<w:r>
<w:rPr>
<w:rFonts w:cs="Tahoma"/>
<w:b/>
<w:sz w:val="20"/>
<w:szCs w:val="20"/>
<w:lang w:val="en-US"/>
</w:rPr>
<w:t xml:space="preserve">, </w:t>
</w:r>
<w:r>
<w:rPr>
<w:rFonts w:cs="Tahoma"/>
<w:b/>
<w:sz w:val="20"/>
<w:szCs w:val="20"/>
</w:rPr>
<w:t>сайт</w:t>
</w:r>
<w:r>
<w:rPr>
<w:rFonts w:cs="Tahoma"/>
<w:b/>
<w:sz w:val="20"/>
<w:szCs w:val="20"/>
<w:lang w:val="en-US"/>
</w:rPr>
<w:t>: www.interpo</w:t>
</w:r>
<w:r>
<w:rPr>
<w:rFonts w:cs="Tahoma"/>
<w:b/>
<w:sz w:val="20"/>
<w:szCs w:val="20"/>
<w:lang w:val="en-US"/>
</w:rPr>
<w:t>l</w:t>
</w:r>
<w:r>
<w:rPr>
<w:rFonts w:cs="Tahoma"/>
<w:b/>
<w:sz w:val="20"/>
<w:szCs w:val="20"/>
<w:lang w:val="en-US"/>
</w:rPr>
<w:t>-nsk.ru</w:t>
</w:r>
</w:p>
<w:p>
<w:pPr>
<w:tabs>
<w:tab w:val="left" w:pos="5408"/>
</w:tabs>
<w:spacing w:after="0" w:line="240" w:lineRule="auto"/>
<w:ind w:left="1560"/>
<w:jc w:val="both"/>
<w:rPr>
<w:rFonts w:cs="Tahoma"/>
<w:b/>
<w:sz w:val="20"/>
<w:szCs w:val="20"/>
</w:rPr>
</w:pPr>
<w:r>
<w:rPr>
<w:rFonts w:cs="Tahoma"/>
<w:b/>
<w:sz w:val="20"/>
<w:szCs w:val="20"/>
</w:rPr>
<w:t>ИНН 5402549079 КПП 540201001, ОГРН 1125476048983</w:t>
</w:r>
</w:p>
<w:p>
<w:pPr>
<w:spacing w:after="0" w:line="240" w:lineRule="auto"/>
<w:ind w:left="1560"/>
<w:jc w:val="both"/>
<w:rPr>
<w:rFonts w:cs="Tahoma"/>
<w:b/>
<w:sz w:val="20"/>
<w:szCs w:val="20"/>
</w:rPr>
</w:pPr>
<w:r>
<w:rPr>
<w:rFonts w:cs="Tahoma"/>
<w:b/>
<w:sz w:val="20"/>
<w:szCs w:val="20"/>
</w:rPr>
<w:t>р/с 40702810401300023124 в «Банк24.ру» (ОАО) г.Екатеринбург</w:t>
</w:r>
</w:p>
<w:p>
<w:pPr>
<w:pBdr>
<w:bottom w:val="single" w:color="auto" w:sz="12" w:space="1"/>
</w:pBdr>
<w:spacing w:after="0" w:line="240" w:lineRule="auto"/>
<w:ind w:left="1560"/>
<w:jc w:val="both"/>
<w:rPr>
<w:rFonts w:cs="Tahoma"/>
<w:b/>
<w:sz w:val="20"/>
<w:szCs w:val="20"/>
</w:rPr>
</w:pPr>
<w:r>
<w:rPr>
<w:rFonts w:cs="Tahoma"/>
<w:b/>
<w:sz w:val="20"/>
<w:szCs w:val="20"/>
</w:rPr>
<w:t>БИК 046577859, к/с 30101810600000000859 в ГРКЦ ГУ Банка России по Свердловской области</w:t>
</w:r>
</w:p>
<w:p>
<w:pPr>
<w:spacing w:after="0" w:line="240" w:lineRule="auto"/>
<w:rPr>
<w:rFonts w:cs="Tahoma"/>
</w:rPr>
</w:pPr>
</w:p>
<w:p>
<w:pPr>
<w:spacing w:after="0" w:line="240" w:lineRule="auto"/>
<w:jc w:val="right"/>
<w:rPr>
<w:rFonts w:cs="Tahoma"/>
</w:rPr>
</w:pPr>
<w:r>
<w:rPr>
<w:rFonts w:cs="Tahoma"/>
</w:rPr>
<w:t>Руководителю ООО «Ромашка»</w:t>
</w:r>
</w:p>
<w:p>
<w:pPr>
<w:spacing w:after="0" w:line="240" w:lineRule="auto"/>
<w:jc w:val="right"/>
<w:rPr>
<w:rFonts w:cs="Tahoma"/>
</w:rPr>
</w:pPr>
<w:r>
<w:rPr>
<w:rFonts w:cs="Tahoma"/>
</w:rPr>
<w:t>И.И. Иванову</w:t>
</w:r>
</w:p>
<w:p>
<w:pPr>
<w:spacing w:after="0" w:line="240" w:lineRule="auto"/>
<w:rPr>
<w:rFonts w:cs="Tahoma"/>
</w:rPr>
</w:pPr>
<w:r>
<w:rPr>
<w:rFonts w:cs="Tahoma"/>
</w:rPr>
<w:t>01.01.2014</w:t>
</w:r>
</w:p>
<w:p>
<w:pPr>
<w:spacing w:after="0" w:line="240" w:lineRule="auto"/>
<w:rPr>
<w:rFonts w:cs="Tahoma"/>
</w:rPr>
</w:pPr>
<w:bookmarkStart w:name="_GoBack" w:id="0"/>
<w:bookmarkEnd w:id="0"/>
</w:p>
<w:p>
<w:pPr>
<w:spacing w:after="0" w:line="240" w:lineRule="auto"/>
<w:rPr>
<w:rFonts w:cs="Tahoma"/>
</w:rPr>
</w:pPr>
</w:p>
<w:p>
<w:pPr>
<w:spacing w:after="0" w:line="240" w:lineRule="auto"/>
<w:rPr>
<w:rFonts w:cs="Tahoma"/>
</w:rPr>
</w:pPr>
</w:p>
<w:p>
<w:pPr>
<w:spacing w:after="0" w:line="240" w:lineRule="auto"/>
<w:rPr>
<w:rFonts w:cs="Tahoma"/>
</w:rPr>
</w:pPr>
</w:p>
<w:p>
<w:pPr>
<w:spacing w:after="0" w:line="240" w:lineRule="auto"/>
<w:rPr>
<w:rFonts w:cs="Tahoma"/>
</w:rPr>
</w:pPr>
</w:p>
<w:p>
<w:pPr>
<w:spacing w:after="0" w:line="240" w:lineRule="auto"/>
<w:rPr>
<w:rFonts w:cs="Tahoma"/>
</w:rPr>
</w:pPr>
</w:p>
<w:p>
<w:pPr>
<w:spacing w:after="0" w:line="240" w:lineRule="auto"/>
<w:rPr>
<w:rFonts w:cs="Tahoma"/>
</w:rPr>
</w:pPr>
</w:p>
<w:p>
<w:pPr>
<w:spacing w:after="0" w:line="240" w:lineRule="auto"/>
<w:rPr>
<w:rFonts w:cs="Tahoma"/>
</w:rPr>
</w:pPr>
</w:p>
<w:p>
<w:pPr>
<w:spacing w:after="0" w:line="240" w:lineRule="auto"/>
<w:rPr>
<w:rFonts w:cs="Tahoma"/>
</w:rPr>
</w:pPr>
</w:p>
<w:p>
<w:pPr>
<w:spacing w:after="0" w:line="240" w:lineRule="auto"/>
<w:rPr>
<w:rFonts w:cs="Tahoma"/>
</w:rPr>
</w:pPr>
</w:p>
<w:p>
<w:pPr>
<w:spacing w:after="0" w:line="240" w:lineRule="auto"/>
<w:rPr>
<w:rFonts w:cs="Tahoma"/>
</w:rPr>
</w:pPr>
</w:p>
<w:p>
<w:pPr>
<w:spacing w:after="0" w:line="240" w:lineRule="auto"/>
<w:rPr>
<w:rFonts w:cs="Tahoma"/>
</w:rPr>
</w:pPr>
</w:p>
<w:p>
<w:pPr>
<w:spacing w:after="0" w:line="240" w:lineRule="auto"/>
<w:rPr>
<w:rFonts w:cs="Tahoma"/>
</w:rPr>
</w:pPr>
</w:p>
<w:p>
<w:pPr>
<w:spacing w:after="0" w:line="240" w:lineRule="auto"/>
<w:rPr>
<w:rFonts w:cs="Tahoma"/>
</w:rPr>
</w:pPr>
</w:p>
<w:p>
<w:pPr>
<w:spacing w:after="0" w:line="240" w:lineRule="auto"/>
<w:rPr>
<w:rFonts w:cs="Tahoma"/>
</w:rPr>
</w:pPr>
</w:p>
<w:p>
<w:pPr>
<w:spacing w:after="0" w:line="240" w:lineRule="auto"/>
<w:rPr>
<w:rFonts w:cs="Tahoma"/>
</w:rPr>
</w:pPr>
</w:p>
<w:p>
<w:pPr>
<w:spacing w:after="0" w:line="240" w:lineRule="auto"/>
<w:rPr>
<w:rFonts w:cs="Tahoma"/>
</w:rPr>
</w:pPr>
</w:p>
<w:p>
<w:pPr>
<w:spacing w:after="0" w:line="240" w:lineRule="auto"/>
<w:rPr>
<w:rFonts w:cs="Tahoma"/>
</w:rPr>
</w:pPr>
</w:p>
<w:p>
<w:r>
<w:rPr>
<w:noProof/>
</w:rPr>
<w:drawing>
<wp:anchor distT="0" distB="0" distL="114300" distR="114300" simplePos="false" relativeHeight="251658240" behindDoc="true" locked="false" layoutInCell="true" allowOverlap="true">
<wp:simplePos x="0" y="0"/>
<wp:positionH relativeFrom="column">
<wp:posOffset>3225800</wp:posOffset>
</wp:positionH>
<wp:positionV relativeFrom="paragraph">
<wp:posOffset>11430</wp:posOffset>
</wp:positionV>
<wp:extent cx="2094865" cy="1658620"/>
<wp:effectExtent l="0" t="0" r="635" b="0"/>
<wp:wrapNone/>
<wp:docPr id="1" name="Picture 1" descr="печать"/>
<wp:cNvGraphicFramePr>
<a:graphicFrameLocks noChangeAspect="true"/>
</wp:cNvGraphicFramePr>
<a:graphic>
<a:graphicData uri="http://schemas.openxmlformats.org/drawingml/2006/picture">
<pic:pic>
<pic:nvPicPr>
<pic:cNvPr id="0" name="Picture 2" descr="печать"/>
<pic:cNvPicPr>
<a:picLocks noChangeAspect="true" noChangeArrowheads="true"/>
</pic:cNvPicPr>
</pic:nvPicPr>
<pic:blipFill>
<a:blip cstate="print" r:embed="rId8">
<a:extLst>
<a:ext uri="{28A0092B-C50C-407E-A947-70E740481C1C}">
<a14:useLocalDpi val="0"/>
</a:ext>
</a:extLst>
</a:blip>
<a:srcRect/>
<a:stretch>
<a:fillRect/>
</a:stretch>
</pic:blipFill>
<pic:spPr bwMode="auto">
<a:xfrm>
<a:off x="0" y="0"/>
<a:ext cx="2094865" cy="1658620"/>
</a:xfrm>
<a:prstGeom prst="rect">
<a:avLst/>
</a:prstGeom>
<a:noFill/>
<a:ln>
<a:noFill/>
</a:ln>
</pic:spPr>
</pic:pic>
</a:graphicData>
</a:graphic>
</wp:anchor>
</w:drawing>
</w:r>
</w:p>
<w:p>
<w:pPr>
<w:spacing w:after="0" w:line="240" w:lineRule="auto"/>
<w:ind w:left="567"/>
<w:rPr>
<w:rFonts w:cs="Tahoma"/>
<w:sz w:val="24"/>
<w:szCs w:val="24"/>
</w:rPr>
</w:pPr>
</w:p>
<w:p>
<w:pPr>
<w:spacing w:after="0" w:line="240" w:lineRule="auto"/>
<w:ind w:left="567"/>
<w:rPr>
<w:rFonts w:cs="Tahoma"/>
<w:sz w:val="24"/>
<w:szCs w:val="24"/>
</w:rPr>
</w:pPr>
</w:p>
<w:p>
<w:pPr>
<w:spacing w:after="0" w:line="240" w:lineRule="auto"/>
<w:ind w:left="567"/>
<w:rPr>
<w:rFonts w:cs="Tahoma"/>
<w:sz w:val="24"/>
<w:szCs w:val="24"/>
</w:rPr>
</w:pPr>
</w:p>
<w:p>
<w:pPr>
<w:spacing w:after="0" w:line="240" w:lineRule="auto"/>
<w:ind w:left="567"/>
<w:rPr>
<w:rFonts w:cs="Tahoma"/>
<w:sz w:val="24"/>
<w:szCs w:val="24"/>
</w:rPr>
</w:pPr>
</w:p>
<w:p>
<w:pPr>
<w:spacing w:after="0" w:line="240" w:lineRule="auto"/>
<w:ind w:left="567"/>
<w:rPr>
<w:rFonts w:cs="Tahoma"/>
<w:sz w:val="24"/>
<w:szCs w:val="24"/>
</w:rPr>
</w:pPr>
<w:r>
<w:rPr>
<w:rFonts w:cs="Tahoma"/>
<w:sz w:val="24"/>
<w:szCs w:val="24"/>
</w:rPr>
<w:t>С уважением,</w:t>
</w:r>
</w:p>
<w:p>
<w:pPr>
<w:spacing w:after="0" w:line="240" w:lineRule="auto"/>
<w:ind w:left="567"/>
<w:rPr>
<w:rFonts w:cs="Tahoma"/>
<w:sz w:val="24"/>
<w:szCs w:val="24"/>
</w:rPr>
</w:pPr>
<w:r>
<w:rPr>
<w:rFonts w:cs="Tahoma"/>
<w:sz w:val="24"/>
<w:szCs w:val="24"/>
</w:rPr>
<w:t>Генеральный директор ООО «ИнтерПол»</w:t>
</w:r>
<w:r>
<w:rPr>
<w:rFonts w:cs="Tahoma"/>
<w:sz w:val="24"/>
<w:szCs w:val="24"/>
</w:rPr>
<w:tab/>
</w:r>
<w:r>
<w:rPr>
<w:rFonts w:cs="Tahoma"/>
<w:sz w:val="24"/>
<w:szCs w:val="24"/>
</w:rPr>
<w:tab/>
</w:r>
<w:r>
<w:rPr>
<w:rFonts w:cs="Tahoma"/>
<w:sz w:val="24"/>
<w:szCs w:val="24"/>
</w:rPr>
<w:tab/>
</w:r>
<w:r>
<w:rPr>
<w:rFonts w:cs="Tahoma"/>
<w:sz w:val="24"/>
<w:szCs w:val="24"/>
</w:rPr>
<w:tab/>
</w:r>
<w:r>
<w:rPr>
<w:rFonts w:cs="Tahoma"/>
<w:sz w:val="24"/>
<w:szCs w:val="24"/>
</w:rPr>
<w:tab/>
<w:t>А.А. Воронович</w:t>
</w:r>
</w:p>
<w:p>
<w:pPr>
<w:spacing w:after="0" w:line="240" w:lineRule="auto"/>
<w:rPr>
<w:rFonts w:cs="Tahoma"/>
</w:rPr>
</w:pPr>
</w:p>
<w:sectPr>
<w:pgSz w:w="11906" w:h="16838"/>
<w:pgMar w:top="284" w:right="707" w:bottom="568" w:left="851" w:header="708" w:footer="708" w:gutter="0"/>
<w:cols w:space="708"/>
<w:docGrid w:linePitch="360"/>
</w:sectPr>
</w:body>
</w:document>
Re: adding multiple lines of text to title
Posted:
Thu Feb 20, 2014 10:01 pm
by jason
yurylankovskiy wrote:I don't understand how shall I import the image into the document
You need an image part, and a matching relid.
Please study/try the ImageAdd example I linked to in your StackOverflow question.
Is your native language Russian by any chance? If so, have your read our Russian language documentation at
https://github.com/plutext/docx4j/tree/master/docs
Re: adding multiple lines of text to title
Posted:
Thu Feb 20, 2014 10:08 pm
by yurylankovskiy
I saw the link, and I already came across it a few days ago. I've tried various ways to insert image and tested with different images but always kept getting the same error, that you saw from stackoverflow. I think the easiest workaround would be to just have a template and change the required fields.
Thanks for the help
Re: adding multiple lines of text to title
Posted:
Thu Feb 20, 2014 10:27 pm
by jason
When I looked at what you were doing on stack overflow, you weren't trying the simple example suggested (ie pass your image to BPAI as a byte array .. last I looked you were trying to pass a file or file path). The ImageAdd example should work. It has worked for years...
Re: adding multiple lines of text to title
Posted:
Fri Feb 21, 2014 4:05 am
by yurylankovskiy
I have tried many ways, including passing byte array. I made sure I could read the file and the bytes read matched the file size. Still got the error....
Re: adding multiple lines of text to title
Posted:
Fri Feb 21, 2014 8:44 am
by jason
Please run the ImageAdd sample, changing only line 44 to point to an image on your filesystem, then post resulting stacktrace (if any..)