HTML to PDF / DOCX / RTF Java converter library › Forums › PD4ML v3 Archived Forums (Read Only) › General questions / FAQ › PD4ML encoding issue (works on mac, not on linux)
- This topic has 2 replies, 1 voice, and was last updated Apr 14, 2015
12:03:01 byAnonymous.
-
AuthorPosts
-
April 14, 2015 at 11:48#27008
Hi,
I am using the command line to convert HTML to PDF on my macbook.
I have a mirrored setup on an Ubuntu server, also Java installed.
Conversions are okay, but some characters are not encoded and result in ??.The file mimetype both on the server and my local dev is: UTF-8 (file –mime-encoding merged_booklet.xhtml)
A part of the file:
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops"> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=420,height=420" /> <title>Jouw_schoonheid_[NETQ_demo_versie_23]-1</title> <link href="http://project-beauty.local/wp-content/uploads/booklet/src/nl/pdf/0.1.16/src/OEBPS/css/idGeneratedStyles.css" rel="stylesheet" type="text/css" /> </head> <body id="Jouw_schoonheid_-NETQ_demo_versie_23--1" lang="en-US" xml:lang="en-US" style="width:420px;height:420px"><div class="page"> <div class="page"> <div id="_idContainer009" class="Basistekstkader"> <div style="width:340.15px;height:340.15px;position:absolute;top:0.05px;left:0px;"> <p class="Pag-4--colofon-top ParaOverride-1"><span id="_idTextSpan026" class="CharOverride-5" style="position:absolute;top:4.29px;left:0px;">© </span>
The © character in the last span for example does not get converted properly on my ubuntu box. On the mac, the PDF looks fine.
Where should I start to look, because I know ubuntu supports utf-8, so I try to force pd4ml.jar to run in utf-8 mode?
Hope you can help me out.
Very happy with PD4ml, works like a charm.April 14, 2015 at 11:52#29711By the way I use TTF:
$cmdline = "$java -Xmx512m -Djava.awt.headless=true -cp $jar Pd4Cmd "$url" 420 420x420 -debug -ttf $fontsdir -insets 0,0,0,0,mm -out $pdfname 2>&1";
and the TTF fonts are working fine.
The fonts that I use are:#this is an autogenerated file. please remove manually any references to copyrighted fonts #Sun Dec 07 15:44:21 EST 2014 AmerType Md BT Bold=AmerTypewriterITCbyBT-Bold.ttf AmerType Md BT=AmerTypewriterITCbyBT-Medium.ttf Helvetica=helr45w.ttf Helvetica Bold=helr65w.ttf Helvetica Bold Oblique=helr66w.ttf Helvetica Narrow=helr47w.ttf Helvetica Narrow Bold=helr67w.ttf Helvetica Narrow Bold Oblique=helr68w.ttf Helvetica Narrow Oblique=helr48w.ttf Helvetica Neue=HelveticaNeue_0.ttf Helvetica Neue Bold=HelveticaNeueBold_0.ttf Helvetica Neue Bold Italic=HelveticaNeueBoldItalic_0.ttf Helvetica Neue Condensed Black=HelveticaNeueCondensedBlack_0.ttf Helvetica Neue Italic=HelveticaNeueItalic_0.ttf Helvetica Neue Light=HelveticaNeueLight_0.ttf Helvetica Neue Light Italic=HelveticaNeueLightItalic_0.ttf Helvetica Neue UltraLight=HelveticaNeueUltraLight_0.ttf Helvetica Neue UltraLight Italic=HelveticaNeueUltraLightItalic_0.ttf Helvetica Oblique=helr46w.ttf Myriad Pro=MyriadPro-Regular.otf
April 14, 2015 at 12:03#29712Adding -encoding utf-8 to the java command line fixed it on Ubuntu.
-
AuthorPosts
The forum ‘General questions / FAQ’ is closed to new topics and replies.
