I am using Evo HTML to PDF library, and trying to find possibility to add custom properties to generated PDF (PDF meta-data - custom properties as key-value).
Does such feature exist in any of your libraries or should I use another library for adding these custom properties to PDF?
Looking through the EVO HTML to PDF converter client documentation, I can't find a reference to the key-value custom properties either.
Workarounds
(Ab)use the Description property of the Document Information class, but I'm not sure if there are (length) limitations).
Attach a file to the PDF with AddFileAttachment.
Related
I am working on a prototype using iText7 for C#. The PDF I am using is an XFAForm PDF and was created in Adobe Live Cycle Designer. From my research, XFAForms do not support annotations. I was going to add an annotation to the field with a link.
I want to be able to edit the value in a field to include a URL. For example,
Name : Marc
should be:
Name : Marc https://www.google.com
I am able to modify the value in this field, but no luck adding a URL that is clickable. I have tried the following:
element.Add(new XAttribute("href", injectedURL)); element is an XElement
Injecting HTML as the new value with a link
I was thinking about reading the XML, parsing it and injecting the URL in the XML and then writing it back to the PDF, but I do not feel that is a good solution.
Has anyone been able to do this?
When exporting my diagram created via local draw.io into a png named "sample.png"I can import it back into a blank draw.io project and the objects are parsed out allowing me to proceed with editing the diagram via draw.io
When I create a new diagram via the draw.io plugin on confluence I am unable to replicate this behaviour - instead my diagram is displayed as an image within the local draw.io diagram
My hope was to programmatically manipulate the xml that is probably "hidden" somewhere in sample.png (How to programatically extract XML data from draw.io PNG) I am searching for a way to force confluence to use the "draw.io formatted png" instead of what I assume to be a default format
It's not supported in Confluence. You would have to specifically export PNG+XML.
Using iText, need help to apply existing pdf with non-embedded fonts stored on file system.
a. I have pdf documents with non-embedded fonts (pdf include the name of the font). I have all these non-embedded fonts available on file system.
b. I need to modify the existing pdf by applying these fonts.
Can someone please help in providing a working code snippet. Thanks in advance.
I have a .rtf file that I need to display within a JavaFX GUI.
My research indicates that the JavaFX TextFlow supports rich text through a tree of Node objects. However, I am at a loss on how to get my .rtf file represented as this tree of Nodes.
I feel like there should be an intuitive way to parse the .rtf file into the Node tree, but I just can't seem to find a way to do it!
Parsing RTF and Rendering in a TextFlow
You could parse the rtf and generate a TextFlow representation of it (similar as is done for this markdown editor for markdown markup). I believe this would be a difficult task for you (the RTF 1.9.1 specification is 277 pages long). Describing how to do this would be too long and complicated for a StackOverflow answer (even if I could describe it, which I probably could not).
Converting RTF to a format JavaFX can more easily render
I suggest using a converter (either offline or using an online service) to convert your RTF to another format before trying to render it in JavaFX. If you know the documents in advance you can pre-convert before shipping your application, if you don't then you will have to provide a real-time conversion facility with your application. I won't recommend a particular service, but you can google and do some research on RTF conversion to see if there is one that fits. As a target format you could choose PDF or HTML, or an image (e.g. PNG).
JavaFX will natively display:
Images using an ImageView.
HTML using a WebView.
A 3rd party library can be used to display PDF documents or other formats using JavaFX.
I am using mupdf to render PDFs in my c++ application but I also need to edit PDFs (inserting a picture for example) but I cannot for the life of my figure out how - it's not documented very well. Ghostscript says that there is an API in mupdf to modify PDFs here http://www.ghostscript.com/MuPDF.html.
Ultimately I am hoping to be able to edit PDFs using MuPDF rather than using another library.
Any help would be appreciated, thanks!
The modification API in MuPDF is for editing the structure of a PDF (such as reordering pages, adding or removing annotations, etc) at a fairly low level. The graphics in PDF are based on a "content stream" object containing the commands for drawing a page using a subset of PostScript. There are no functions for editing these graphics content streams in MuPDF.
However, if all you want to do is add an image on top of the page, you can do so by creating an annotation object for the page. You'll need to create the PDF dictionary objects for the annotation, an image object, an appearance stream to draw the image object, and hook them up to the page. You'll need a good understanding of the PDF format to do this though.
You'll want to use the latest git checkout of MuPDF since we've recently (post 1.0 release) added some convenient functions for editing objects and updating streams with new content.