Hi,
I use Programmatic Tag(*1) for markup.
Sample source(*2) is below. (the source is for markup not paragraph. for
body)
tagValue param is "ID-number ".
public static String SCHMATYPE_SDT =
CTSdtContentBlock.Factory.newInstance().schemaType()
public void addNewBodyAsPgSDT( CTBody mainBody,CTBody addBody, String
tagValue, CTSectPr addSectPr ) throws XmlException{
CTSdtBlock sdt = mainBody.addNewSdt();
CTSdtPr sdtPr =sdt.addNewSdtPr();
sdtPr.addNewRPr().addNewRFonts().setHint(STHint.EAST_ASIA);
sdtPr.addNewTag().setVal(tagValue);
sdtPr.addNewLock().setVal(STLock.SDT_LOCKED);
CTSdtContentBlock content =sdt.addNewSdtContent();
content.set( addBody.changeType(SCHMATYPE_SDT) );
content.addNewP().addNewPPr().addNewSectPr().set(addSectPr);
}
*1 c051463_ISOIEC 29500-1_2008(E).pdf
17.5.2.42 tag (Programmatic Tag)
*2 based on poi 3.5
Yoshitake
(2011/03/29 5:16), smer4 wrote:
(first sorry for my english lol)
My task is:
Java program exports in .docx a List of Strings.
Each String is written in separate paragraph.
Each this String with must have in the document some kind of ID-number
or some other marker, so user can not change the relationship ID to String.
ID can be displayed as a digit whitch a user can not change, or ID can be
invisible.
As a user copys or moves Text, the ID must move with it.
After a work with a .docx File user will have the Strings in wrong order,
but the Java-programm must know the right order according to the IDs.
My Ideas:
Setting StyleID - kinda not work
Setting Test - 001. String1, 002. String2 - the User can change it
Any suggestions please??
--
View this message in context:
http://apache-poi.1045710.n5.nabble.com/Setting-an-ID-or-some-marker-on-Text-with-XWPF-tp4268252p4268252.html
Sent from the POI - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]