Cannot extract the embedded font - Code Igniter and dompdf - codeigniter

Following the instruction in this link ( https://github.com/EllisLab/CodeIgniter/wiki/PDF-generation-using-dompdf ), I always encounter an error when opening the pdf file created. The error message is:"Cannot extract embedded font 'TradeGothicLT-CondEighteen'.Some characters may not display or print correctly. " and when i click OK, the pdf displays black background and when i start highlighting the body, it captures the text but text are in black font-color. what should I do to get rid of this error?

There may be something wrong with your font cache, located at dompdf/lib/fonts/dompdf_font_family_cache.php (though the exact file name depends on your release and whether you have loaded fonts). This file tells dompdf what fonts are available for use in the PDF. If this file references a font that isn't actually available you can run into major issues on viewing. You may need to re-load your font files. Take a look at the Unicode how-to for an overview of using embedded fonts. This document hasn't been updated to reflect changes implemented in dompdf 0.6.0 beta 3, but the information is still pertinent.

Related

LibreOffice Writer - captions crop figures

I am creating a report meant to be read/edited by MS Word. To do that I have created it from scratch and saved as .docx.
In this report I am including some images together with captions. All of the captions were added manually. Everything went fine, I have saved the document and closed Writer.
Now I want to put my hands on it again and, upon opening the report, this is what I am seeing:. Previously the figure was showing fine inside the text box (that inserting a caption creates). The text box is in the same position and size, but there appears to be a boundary over which it just displays white. I can reduce the figure's size inside the boundary of visibility, and a glimpse of the captions appears too .
Note that the red arrow disappears too.
Needless to say, I can not work on a 100+ pages document and then check again each picture, delete it and re-create it, check again the cross references and so on. I would much rather work with LaTeX, but I am required to deliver a .docx file.
I am working on Ubuntu 20.04, Libreoffice is updated to version 6.4.6.2 and the only plugins I have equipped it are TexMath and Zotero.
Thank you for your time.
I noticed the same thing. It seems to be an issue already in Libreoffice Writer between Linux and Windows. If you create a document on Linux with a cropped image and then open the file in Libreoffice on Windows the cropping of that image is already messed up. Happens to me with Libreoffice Version 6.3.5.2.

Ghostscript PDF fonts becomes boxes in Adobe Illustrator where as its output is fine when opened in Adobe Acrobat

I need to convert the PDF of RGB color space to Grayscale using commandline tool supporting for Windows and Linux.
When i used Ghostscript the conversion is happening but when the output is opened in illustrator the fonts were shown as boxes.
Is there any solution option available in Ghostscript to overcome this font issue.
Is there any other commandline tool available for this conversion.
The font encoding is always built in is there any ways available to change it as ANSI encoding.Screenshot of font issue on illustrator VS the working scenario on acrobat
Pictures of the problem really don't help. You need to provide the following:
The version of Ghostscript you are using, and the platform (Linux, Windows etc), the word size of the version of Ghostscript and where you sourced this version of Ghostscript from (official Ghostscript download page, package, self-built binary).
An example file to reproduce the problem
The exact command line you used to reproduce the problem, and any supporting files required.
I suspect that your problem is that the original PDF file does not include the fonts that it uses, and that you have left SubsetFonts as true, and have left the AlwaysEmbed and NeverEmbed arrays untouched. This will mean that the new PDF file also does not include the fonts, which means that any PDF consumer must use a substitute font. The 'boxes' you refer to are /.notdef glyphs which are used when the font does not contain the glyph being requested.
Having the Encoding 'built-in' doesn't help with anything at all, it's the presence or absence of the fonts which matters. No, you can't change the encoding to 'ANSI', if you do that (assuming it isn't already WinAnsiEncoding) you'll see very similar problems to the ones you are complaining of here. You would also need to change the text character codes in the PDF file to be able to change the Encoding.
You could also raise this as a bug at https://bugs.ghostscript.com, where you will also have to supply an example file (as simple as possible) and all the other information listed above.

using google web fonts on mac computer

I'm building a web page that uses Google WebFonts (open sans) on a PC and it works perfectly, but when I try it on a mac computer it shows a question mark within the text. Why is this?
The character you are seeing is the replacement character, which is used when a font does not contain a particular Unicode character, in this case, "ñ" AKA U+00F1 AKA "Latin small letter n with tilde".
Google Open Sans does contain this character, so it seems that Safari is not correctly getting the font from the web. The rendering engine is then reverting to another font, and that one is missing the offending character. You will be able to check in dev tools on your mac which font is being grabbed by your script.
I checked the script annotation you posted in the comment to your question. You are returning the fonts in the woff2 format. It turns out that woff2 is not supported in Safari as of version 9, but woff is. I therefore recommend changing the format to woff and serving it to your page locally:
Download the script you posted (http://fonts.googleapis.com/css?family=Open+Sans:300,400,500,700)
Save it as a css file (e.g. fonts.css)
Find-and-replace woff2 to woff
Save the file
Add it to your web project (however you add your other files)
Replace #StyleSheet({"fonts.googleapis.com/css?family=Open+Sans:300,400,500,700";}‌​) with a reference to this newly uploaded file.
Solved! One of the developers had its Eclipse not set to UTF-8 so the file transfer using Git wasn't working properly...to check, go to Preferences>General>Workspace>Text file encoding and set to UTF-8

How do I use Verdana in domPDF?

I'm using WAMP and CodeIgniter. I'm using DomPDF and it works really great. Now I want to change font to Verdana in the PDFs that are created. As I understand from doing som reading Verdana isn't included in the core files of domPDF, but it is possible to add fonts.
I just found this.
https://code.google.com/p/dompdf/source/browse/trunk/dompdf/lib/fonts/Verdana.ufm?r=96
But I want to download som font-files where Verdana is used for domPDF. How do I achieve that? (I'm looking for some download verdanafonts.zip or something like that)
I've tried to copy the contents of verdana.ufm and verdana.afm and saved them into the libs/fonts folder and change def("DOMPDF_DEFAULT_FONT", "serif"); TO def("DOMPDF_DEFAULT_FONT", "verdana"); but then I get an error that says verdana is an undefined index.
I'm using 0.6 version of domPDF.
In order to add a font to dompdf you have to parse it to produce the font metrics file (*.AFM and/or *.UFM). Then you have to tell dompdf about the font by editing lib/fonts/dompdf_font_family_cache.
dompdf has always had a mechanism to help you out with the process. The load_font.php file will take a font and so long as the necessary libraries are available will produce the metrics and update your font family cache. With dompdf v0.6.x the php-font-lib font parsing library is used to produce the font metrics.
You can also use the CSS #font-face declaration to load fonts on-the-fly.

How do you reliably render Khmer (Indic) fonts on the web (and in PDFs)?

I've been having a world of trouble getting Khmer fonts (an Indic script of Cambodia) to render reliably on the web across platforms (Mac, Windows, Linux).
Google web fonts recently added Khmer, which seems like the best bet. However, I have not been successful getting Khmer fonts to work on any Mac or Linux system. I can get them to work on Windows by installing the Khmer Unicode installer from http://khmeros.info but not by just including Google's font in an HTML file.
For example, see this screenshot of the Google web fonts page on a fresh Windows installation. You can see that the default Windows Khmer font (uuuuugly!) is being used instead of Danh's pretty fonts.
I have another test file here: http://dl.dropbox.com/u/634/khmer_test.html. For the first test, you should see something like this for both the web font and the default system font (assuming you have Hanuman installed). I have yet to find a system where both examples work reliably.
Any help would be greatly appreciated. My primary goal is to get this working on a website; a secondary goal is to get Khmer (and other Indic fonts) working in a PDF generator like iText (although I am aware iText itself does not support Indic fonts -- I'm hoping something similar does).
Every Cambodian Windows users are always delete the font name called: KhmerMool and Khmer Kampot. Then they change the default Khmer font in regedit too. You can check at http://thelifeandwork.blogspot.com/2010/01/changing-default-khmer-font-in-windows.html . I'm not sure about Khmer font and other Indic font in PDF. I always have problem when i copy Khmer unicode from PDF to put in OpenOffice or Office Word or LibreOffice.
Khmer Unicode displays on the web, it will always solve now by Google Webfont, please refer to that.
And if you want to have Khmer display in PDF by converting using iText, you can see following post:
Khmer Unicode in iText
http://ask.osify.com/qa/287
They are currently not yet support the display yet.
But, just today I can get it works by modifying the source code of iText (5.5.4-SNAPSHOT) as I just stated in my post: http://ask.osify.com/qa/613, not yet be able to publish since it's just start in testing around.
Updated 13/01/2016
I have added the source code sample for the rendering: http://ask.osify.com/qa/613
The rendering customization with iText for Khmer Unicode added in github: https://github.com/Seuksa/iTextKhmer

Resources