creating PDF/A-1b without needing a Helvetica Font file -
I need to make some simple but PDF / A-1b analog PDF files using IText.
My first approach looks like this:
document document = new document (pages.4a); BytereonOperputTream PDFFIFF = New BytereOutStream); PdfARI pdfarr = pdfararr.engense (document, pdf buffer, pdfxfonlolive.pdfbbbb); PdfAWriter.createXmpMetadata (); Font fixed font = fontfactor.gatefont ("courier new", base font.cp 1252, base font. Embedded, 10, font normal); Document.open (); Chuck Chuck = New Chuck ("Hello World", Fixed Font); Paragraph paragraph = new paragraph (slice); Document.add (paragraph); Document.close (); // This is the pseudo code for transferring a buffer to a real file. BitteArrayToFile (pdfBuffer.toByteArray ()); Thos code generates an error message:
All fonts must be embedded. It is not one: Hellevica
Look around I found that the helvetica is the default document font of iTextn that can not be changed, it is a base PDF font that is not embedded by default And that if I do not want to buy a Helvetica PFB or TTF file (which I do not have and I'm not planning to use that document in all my documents Only) I can embed it.
There is no need for any hellevica text in my pdf. I need to create PDF / A-1B, which needs to be embedded in all fonts including PDF Base Fonts.
So is this a bug? If a Helvetica font file is not available, what is the correct way to generate PDF / A with iText?
My first reaction will be consistent with the comments made by @rekire: this is a very strange question. One of the mandatory requirements of PDF / A file is that you embed each font, you are now asking for a PDF / a document such as without adding any font like Helvetica it will be a document without any text .
You have not responded to this response, but the possible answer is: If you look at your code, then you are clearly watching that I am not using Hellevastica, I am using "Courier New"
This is my second reaction: You are not using Courier New! This row is not enough:
font defined font = fontfactor.gatefont ("courier new", basefont.cp 1252, basefonts embedded, 10, font normal); I do not register courier.ttf anywhere. Therefore iText does not know where to find the Courier New, instead it uses Helvetica when I consult (a book which I can highly recommend), I get the following questions:
The answers to these questions show what is going wrong in your example. Note that you will find some full PDF / A examples on the official iText site.
Comments
Post a Comment