How to add a image to docx by docx4j use anchor not inline picture? - openxml

How to add a image to docx by docx4j use anchor not inline picture?
most answer I find is inline picture,i want to add a suspension image into docx by docx4j.

I suggest you create blank document with just one inline image.
follow this code
Then:
change it to anchor in MS Word
print main document xml in your Unit Test or on webapp
cut the anchor part and unmarshal it to Anchor JAXB object
instead of Inline, add Anchor to drawing.
don't forget to refer to the image in your Anchor.
There is a section a:blip r:embed="relId". You can get the value from imagePart.getRelLast().getId(). Just unzip your docx file and have a look at word/_rels/document.xml.rels

Related

How to make input in HTML for Telerik

I am doing export to PDF from HTML. I want to add input fields into my HTML code, but I don't know how.
I have tried a lot of combinations, but nothing is working.
Here is example what I tried:
enter image description here
You can use RadClientExportManager to export HTML content and elements to PDF. For example, see this demo - https://demos.telerik.com/aspnet-ajax/client-export-manager/functionality/export-html-elements/defaultcs.aspx.
Another approach to export HTML to PDF is to use the Kendo Drawing API.

How I can clean the pdf view

I have a form that makes a pdf when finished and I'm using flutter_pdfview package to view the pdf. I expect to finish the form and view the pdf, but if I want to modify something I want to see the changes, but I just see the first version of the pdf. I have this theory that if I clean the String of the path that pdfview uses to render the pdf. Maybe I could see some changes, but well I have no idea.
Thanks for your attention!

How do I move or include compressed and concatenated CSS to footer in TYPO3?

Seems like a simple question, since you can do it with JS files, but I can't seem to find an answer.
I know for javascript things like moveJsFromHeaderToFooter and includeJSFooter exist in typoscript config, but no such setting for stylesheets.
I compress and concatenate my stylesheets as well, so the result isn't a static file either.
I am not discussing its right or not but if you want to move whole CSS to footer here is the solution:
Copy file public/typo3/sysext/core/Resources/Private/Templates/PageRenderer.html to some location in your basic extension like myext/Resources/Private/Templates/PageRenderer.html
In Template Typoscript put:
config.pageRendererTemplateFile = EXT:myext/Resources/Private/Templates/PageRenderer.html
In myext/Resources/Private/Templates/PageRenderer.html you see markers. Just move CSS markers you want to bottom.
The style tag is only valid in the head section. Thats why TYPO3 does not provide a move to footer option.
See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/style
So please create valid html

Export SAPUI5 Network Graph as PDF

I'm trying to export the Ui control sap.ui.commons.networkgraph.Graph as PDF.
I follow this guide to rendering an org.chart
https://sapui5.netweaver.ondemand.com/sdk/#/sample/sap.suite.ui.commons.sample.NetworkGraphOrgChart/preview
I've tried jspdf to render but what I've got looks like this
I've also tried html2pdf as this link: https://github.com/eKoopmans/html2pdf.js to render but what I've got looks like this
AFAIK, these tools use svg string to render PDF. But the svg string I tried to retrieved from network graph is not enough. It miss the svg lines.
In the other hand, sapui5's Vizframe do very well exporting to PDF, thanks to the provided ExportToSVGString method.
Any suggestions please ?
In the worst case, I would have to write a function to render these graphic to svg (like the method exportToSVGString).

itextpfg 5.5.0 add watermark to existing pdf for printing only

I am new to the PDF and have been working through examples and have understood the technology. I want be able to print watermark on existing pdf, but not show it in viewing mode. I am using PdfStamper to read in the existing pdf and then adding PdfLayer using getUnderContent(pagenum) and adding the watermark the layer. I set the attributes of layer for print to be true and false to be visible.
When I try to print it, no watermark. Now I can hide the watermark and printed if I create new pdf, but on existing pdf.
Any idea what I am doing wrong?