Is there any way to open a rtf-File?
I tried:
WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.load(new FileInputStream(new File(dataDir + "file.rtf")));
Or is there another lib wich can do this?
It is currently Fri Nov 29, 2024 2:56 pm
String xmlEllipse = getXmlEllipse();
Object ellipse = XmlUtils.unmarshalString(xmlEllipse);
Graphic ellipseGraphic = (Graphic) ((JAXBElement)ellipse).getValue();
Anchor anchor = new Anchor();
anchor.setGraphic(ellipseGraphic);
ObjectFactory factory = new ObjectFactory();
P paragraph = factory.createP();
R run = factory.createR();
paragraph.getContent().add(run);
Drawing drawing = factory.createDrawing();
run.getContent().add(drawing);
drawing.getAnchorOrInline().add(anchor);
WordprocessingMLPackage newDoc = WordprocessingMLPackage.createPackage();
newDoc.getMainDocumentPart().getContent().add(paragraph);
newDoc.save(new File(dirPath + outputFilePath));
Total posts 10111 • Total topics 2842 • Total members 2074