Quantcast

Change encoding of font

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Change encoding of font

Sascha Fuchs

Hello Paolo Soares,

Hello all

 

Thank you Paolo for your helping hint for reducing redundant font embedding with BaseFont.getDocumentFonts() and replace the FontFile2. It works well (font looks same even font is not installed on local computer) and reduces a lot of needed disk space (factor 10 or more – depending on number of pages).

 

But we need to reduce more disk space (but the font embedding should be kept).

To reduce the needed disk space of a PDF document we want to change the encoding of embedded font from ASCIIHexDecode (not very memory efficient encoding – 40% overhead) to another, like LZWDecode.

 

I see following two possible ways to solve the problem:

1: Get the stream of the font ‘embedding’ (I know how to) -> get the decoded data (I guess with PdfReader.ASCIIHexDecode(byte-array-of-stream) ) -> encode the data to more ‘efficient’ encoding (I don’t know how to) -> replace old stream (I guess I know how)
 
2: Get the stream of the font ‘embedding’ (I know how to) -> get the decoded data (I guess with PdfReader.ASCIIHexDecode(byte-array-of-stream) ) -> create a new font with decoded data as font embedding and encoding (I don’t’ know how – I guess with instance of BaseFont) -> replace the FontFile2 (now I know how to)…
 
Can somebody help me?
 
Thanks in advance and best regards,
Sascha Fuchs

 


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
iText-questions mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Change encoding of font

Paulo Soares
 

> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On
> Behalf Of Sascha Fuchs
> Sent: Monday, April 16, 2007 10:09 AM
> To: Post all your questions about iText here
> Subject: [iText-questions] Change encoding of font
>
> Hello Paolo Soares,
>
> Hello all
>
>  
>
> Thank you Paolo for your helping hint for reducing redundant
> font embedding with BaseFont.getDocumentFonts() and replace
> the FontFile2. It works well (font looks same even font is
> not installed on local computer) and reduces a lot of needed
> disk space (factor 10 or more - depending on number of pages).
>
>  
>
> But we need to reduce more disk space (but the font embedding
> should be kept).
>
> To reduce the needed disk space of a PDF document we want to
> change the encoding of embedded font from ASCIIHexDecode (not
You have a PDF producer that doesn't compress fonts? Amazing.

> very memory efficient encoding - 40% overhead) to another,
> like LZWDecode.
>

FlateDecode.

>  
>
> I see following two possible ways to solve the problem:
>
> 1: Get the stream of the font 'embedding' (I know how to) ->
> get the decoded data (I guess with
> PdfReader.ASCIIHexDecode(byte-array-of-stream) ) -> encode
> the data to more 'efficient' encoding (I don't know how to)
> -> replace old stream (I guess I know how)
>  
> 2: Get the stream of the font 'embedding' (I know how to) ->
> get the decoded data (I guess with
> PdfReader.ASCIIHexDecode(byte-array-of-stream) ) -> create a
> new font with decoded data as font embedding and encoding (I
> don't' know how - I guess with instance of BaseFont) ->
> replace the FontFile2 (now I know how to)...
>  
> Can somebody help me?
>  
You have methods in PdfReader to get the stream content and that already
returns uncompressed. Create a PdfStream with that and replace it in the
apropriate place.

Paulo


Aviso Legal:
Esta mensagem é destinada exclusivamente ao destinatário. Pode conter informação confidencial ou legalmente protegida. A incorrecta transmissão desta mensagem não significa a perca de confidencialidade. Se esta mensagem for recebida por engano, por favor envie-a de volta para o remetente e apague-a do seu sistema de imediato. É proibido a qualquer pessoa que não o destinatário de usar, revelar ou distribuir qualquer parte desta mensagem.

Disclaimer:
This message is destined exclusively to the intended receiver. It may contain confidential or legally protected information. The incorrect transmission of this message does not mean the loss of its confidentiality. If this message is received by mistake, please send it back to the sender and delete it from your system immediately. It is forbidden to any person who is not the intended receiver to use, distribute or copy any part of this message.



-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
iText-questions mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Change encoding of font

Avadhut Karambelkar
HI all
I have also the problem of font
I have following HTML text in file which I am trying to convert in PDF
But it doesn't work out can u help  me PLZ
<font face="arial">
&#260; &#274; &#290; &#298; &#296; &#310; &sect; &#315; &#272; &scaron;
&#358; &shy; &#362; &#330; &deg; &#261; &#275; &#291; &#299; &#297; &#311;
&middot; &#316; &#273; &#359; &#8213; &#363; &#331; &#256; &aacute; &acirc;
&atilde; &auml; &aring; &aelig; &#302; &#268; &eacute; &#280; &euml; &#278;
&iacute; &icirc; &iuml; &eth; &#325; &#332; &oacute; &ocirc; &otilde; &ouml;
&#360; &oslash; &#370; &uacute; &ucirc; &uuml; &yacute; &thorn; &szlig;
&#257; &atilde; &auml; &aring; &aelig; &#303; &#269; &eacute; &#281; &euml;
&#279; &iacute; &icirc; &iuml; &eth; &#326; &#333; &oacute; &ocirc; &otilde;
&ouml; &#361; &oslash; &#371; &uacute; &ucirc; &uuml; &yacute; &thorn;
&#312; &rdquo; &cent; &pound; &curren; &bdquo; &brvbar; &oslash; &copy;
&#342; &laquo; &not; &reg; &plusmn; &sup2; &sup3; &ldquo; &micro; &para;
&sup1; &#343; &raquo; &frac14; &frac12; &frac34; &#262; &#377; &#323;
&times; &#321; &#346; &#379; &#263; &#378; &#324; &divide; &#322; &#347;
&#380; &rsquo; &pound; &#266; &#267; &#7808; &copy; &#7810; &#7922; &reg;
&yuml;&nbsp; &#288; &#289; &para; &#7809; &#7811; &#7923; &#7812; &#7813;
&agrave; &ccedil; &egrave; &ecirc; &igrave; &#372; &ntilde; &ograve;
&ugrave; &#374; &agrave; &ccedil; &egrave; &ecirc; &igrave; &#373; &ntilde;
&ograve; &ugrave; &#375; &yuml; &iexcl; &euro; &yen; &ordf; &macr; &ordm;
&oelig; &oelig; &yuml; &iquest; &agrave; &ccedil; &egrave; &ecirc; &igrave;
&ntilde; &ograve; &ugrave; &agrave; &ccedil; &egrave; &ecirc; &igrave;
&ntilde; &ograve; &ugrave; &yuml; &iexcl; &yen; &uml; &ordf; &macr; &acute;
&cedil; &ordm; &iquest; &agrave; &ccedil; &egrave; &ecirc; &igrave; &ntilde;
&ograve; &ugrave; &ccedil; &egrave; &ecirc; &igrave; &ntilde; &ograve;
&ugrave; &#728; &#317; &uml; &#350; &#356; &#731; &acute; &#318; &#711;
&cedil; &#351; &#357; &#733; &#340; &#258; &#313; &#282; &#270; &#327;
&#336; &#344; &#366; &#368; &#354; &#341; &#259; &#314; &#283; &#271; &#328;
&#337; &#345; &#367; &#369; &#355; &#729; &#294; &#728; &#292; &uml; &#304;
&#350; &#286; &#308; &#295; &acute; &#293; &cedil; &#305; &#351; &#287;
&#309; &#264; &#284; &#364; &#348; &#265; &#285; &#365; &#349; &#729; &uml;
&#731; &acute; &#711; &cedil; &#729; &#1025; &#1026; &#1027; &#1028; &#1029;
&#1030; &#1031; &#1032; &#1033; &#1034; &#1035; &#1036; &#1038; &#1039;
&#1040; &#1041; &#1042; &#1043; &#1044; &#1045; &#1046; &#1047; &#1048;
&#1049; &#1050; &#1051; &#1054; &#1055; &#1056; &#1057; &#1058; &#1059;
&#1060; &#1062; &#1063; &#1064; &#1065; &#1066; &#1067; &#1068; &#1069;
&#1070; &#1071; &#1072; &#1073; &#1074; &#1075; &#1076; &#1077; &#1078;
&#1079; &#1080; &#1081; &#1082; &#1083; &#1086; &#1087; &#1088; &#1089;
&#1090; &#1091; &#1092; &#1094; &#1095; &#1096; &#1097; &#1098; &#1099;
&#1100; &#1101; &#1102; &#1103; &#8470; &#1105; &#1106; &#1107; &#1108;
&#1109; &#1110; &#1111; &#1112; &#1113; &#1114; &#1115; &#1116; &#1118;
&#1119; &#1548; &#1563; &#1567; &#1569; &#1570; &#1571; &#1572; &#1573;
&#1574; &#1575; &#1576; &#1577; &#1578; &#1579; &#1580; &#1581; &#1582;
&#1583; &#1584; &#1585; &#1586; &#1587; &#1588; &#1589; &#1590; &#1591;
&#1592; &#1593; &#1594; &#1600; &#1601; &#1602; &#1603; &#1604; &#1605;
&#1606; &#1607; &#1608; &#1609; &#1610; &#1611; &#1612; &#1613; &#1614;
&#1615; &#1616; &#1617; &#1618; &lsquo; &#900; &#901; &#902; &#904; &#905;
&#906; &#908; &#910; &#911; &#912; &alpha; &beta; &gamma; &delta; &epsilon;
&zeta; &eta; &theta; &iota; &kappa; &lambda; &mu; &nu; &xi; &omicron; &pi;
&rho; &sigma; &tau; &upsilon; &phi; &chi; &psi; &omega; &#938; &#939; &#940;
&#941; &#942; &#943; &#944; &alpha; &beta; &gamma; &delta; &epsilon; &zeta;
&eta; &theta; &iota; &kappa; &lambda; &mu; &nu; &xi; &omicron; &pi; &rho;
&sigmaf; &sigma; &tau; &upsilon; &phi; &chi; &psi; &omega; &#970; &#971;
&#972; &#973; &#974; &#8215; &#1488; &#1489; &#1490; &#1491; &#1492; &#1493;
&#1494; &#1495; &#1496; &#1497; &#1498; &#1499; &#1500; &#1501; &#1502;
&#1503; &#1504; &#1505; &#1506; &#1507; &#1508; &#1509; &#1510; &#1511;
&#1512; &#1513; &#1514; &lrm; &rlm; &#286; &#304; &#287; &#305; &copy; &reg;
&trade;
</font>
Thanks & Regards
Avadhut K

-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Paulo
Soares
Sent: Monday, April 16, 2007 7:22 PM
To: Post all your questions about iText here
Subject: Re: [iText-questions] Change encoding of font

 

> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On
> Behalf Of Sascha Fuchs
> Sent: Monday, April 16, 2007 10:09 AM
> To: Post all your questions about iText here
> Subject: [iText-questions] Change encoding of font
>
> Hello Paolo Soares,
>
> Hello all
>
>  
>
> Thank you Paolo for your helping hint for reducing redundant
> font embedding with BaseFont.getDocumentFonts() and replace
> the FontFile2. It works well (font looks same even font is
> not installed on local computer) and reduces a lot of needed
> disk space (factor 10 or more - depending on number of pages).
>
>  
>
> But we need to reduce more disk space (but the font embedding
> should be kept).
>
> To reduce the needed disk space of a PDF document we want to
> change the encoding of embedded font from ASCIIHexDecode (not

You have a PDF producer that doesn't compress fonts? Amazing.

> very memory efficient encoding - 40% overhead) to another,
> like LZWDecode.
>

FlateDecode.

>  
>
> I see following two possible ways to solve the problem:
>
> 1: Get the stream of the font 'embedding' (I know how to) ->
> get the decoded data (I guess with
> PdfReader.ASCIIHexDecode(byte-array-of-stream) ) -> encode
> the data to more 'efficient' encoding (I don't know how to)
> -> replace old stream (I guess I know how)
>  
> 2: Get the stream of the font 'embedding' (I know how to) ->
> get the decoded data (I guess with
> PdfReader.ASCIIHexDecode(byte-array-of-stream) ) -> create a
> new font with decoded data as font embedding and encoding (I
> don't' know how - I guess with instance of BaseFont) ->
> replace the FontFile2 (now I know how to)...
>  
> Can somebody help me?
>  

You have methods in PdfReader to get the stream content and that already
returns uncompressed. Create a PdfStream with that and replace it in the
apropriate place.

Paulo


Aviso Legal:
Esta mensagem i destinada exclusivamente ao destinatario. Pode conter
informagco confidencial ou legalmente protegida. A incorrecta transmissco
desta mensagem nco significa a perca de confidencialidade. Se esta mensagem
for recebida por engano, por favor envie-a de volta para o remetente e
apague-a do seu sistema de imediato. I proibido a qualquer pessoa que nco o
destinatario de usar, revelar ou distribuir qualquer parte desta mensagem.

Disclaimer:
This message is destined exclusively to the intended receiver. It may
contain confidential or legally protected information. The incorrect
transmission of this message does not mean the loss of its confidentiality.
If this message is received by mistake, please send it back to the sender
and delete it from your system immediately. It is forbidden to any person
who is not the intended receiver to use, distribute or copy any part of this
message.




-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
iText-questions mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Change encoding of font

Paulo Soares
That was already answered.

Paulo

----- Original Message -----
From: "Avadhut Karambelkar" <[hidden email]>
To: "'Post all your questions about iText here'"
<[hidden email]>
Sent: Tuesday, April 17, 2007 4:57 AM
Subject: Re: [iText-questions] Change encoding of font


> HI all
> I have also the problem of font
> I have following HTML text in file which I am trying to convert in PDF
> But it doesn't work out can u help  me PLZ
> <font face="arial">
> &#260; &#274; &#290; &#298; &#296; &#310; &sect; &#315; &#272; &scaron;
> &#358; &shy; &#362; &#330; &deg; &#261; &#275; &#291; &#299; &#297; &#311;
> &middot; &#316; &#273; &#359; &#8213; &#363; &#331; &#256; &aacute;
> &acirc;
> &atilde; &auml; &aring; &aelig; &#302; &#268; &eacute; &#280; &euml;
> &#278;
> &iacute; &icirc; &iuml; &eth; &#325; &#332; &oacute; &ocirc; &otilde;
> &ouml;
> &#360; &oslash; &#370; &uacute; &ucirc; &uuml; &yacute; &thorn; &szlig;
> &#257; &atilde; &auml; &aring; &aelig; &#303; &#269; &eacute; &#281;
> &euml;
> &#279; &iacute; &icirc; &iuml; &eth; &#326; &#333; &oacute; &ocirc;
> &otilde;
> &ouml; &#361; &oslash; &#371; &uacute; &ucirc; &uuml; &yacute; &thorn;
> &#312; &rdquo; &cent; &pound; &curren; &bdquo; &brvbar; &oslash; &copy;
> &#342; &laquo; &not; &reg; &plusmn; &sup2; &sup3; &ldquo; &micro; &para;
> &sup1; &#343; &raquo; &frac14; &frac12; &frac34; &#262; &#377; &#323;
> &times; &#321; &#346; &#379; &#263; &#378; &#324; &divide; &#322; &#347;
> &#380; &rsquo; &pound; &#266; &#267; &#7808; &copy; &#7810; &#7922; &reg;
> &yuml;&nbsp; &#288; &#289; &para; &#7809; &#7811; &#7923; &#7812; &#7813;
> &agrave; &ccedil; &egrave; &ecirc; &igrave; &#372; &ntilde; &ograve;
> &ugrave; &#374; &agrave; &ccedil; &egrave; &ecirc; &igrave; &#373;
> &ntilde;
> &ograve; &ugrave; &#375; &yuml; &iexcl; &euro; &yen; &ordf; &macr; &ordm;
> &oelig; &oelig; &yuml; &iquest; &agrave; &ccedil; &egrave; &ecirc;
> &igrave;
> &ntilde; &ograve; &ugrave; &agrave; &ccedil; &egrave; &ecirc; &igrave;
> &ntilde; &ograve; &ugrave; &yuml; &iexcl; &yen; &uml; &ordf; &macr;
> &acute;
> &cedil; &ordm; &iquest; &agrave; &ccedil; &egrave; &ecirc; &igrave;
> &ntilde;
> &ograve; &ugrave; &ccedil; &egrave; &ecirc; &igrave; &ntilde; &ograve;
> &ugrave; &#728; &#317; &uml; &#350; &#356; &#731; &acute; &#318; &#711;
> &cedil; &#351; &#357; &#733; &#340; &#258; &#313; &#282; &#270; &#327;
> &#336; &#344; &#366; &#368; &#354; &#341; &#259; &#314; &#283; &#271;
> &#328;
> &#337; &#345; &#367; &#369; &#355; &#729; &#294; &#728; &#292; &uml;
> &#304;
> &#350; &#286; &#308; &#295; &acute; &#293; &cedil; &#305; &#351; &#287;
> &#309; &#264; &#284; &#364; &#348; &#265; &#285; &#365; &#349; &#729;
> &uml;
> &#731; &acute; &#711; &cedil; &#729; &#1025; &#1026; &#1027; &#1028;
> &#1029;
> &#1030; &#1031; &#1032; &#1033; &#1034; &#1035; &#1036; &#1038; &#1039;
> &#1040; &#1041; &#1042; &#1043; &#1044; &#1045; &#1046; &#1047; &#1048;
> &#1049; &#1050; &#1051; &#1054; &#1055; &#1056; &#1057; &#1058; &#1059;
> &#1060; &#1062; &#1063; &#1064; &#1065; &#1066; &#1067; &#1068; &#1069;
> &#1070; &#1071; &#1072; &#1073; &#1074; &#1075; &#1076; &#1077; &#1078;
> &#1079; &#1080; &#1081; &#1082; &#1083; &#1086; &#1087; &#1088; &#1089;
> &#1090; &#1091; &#1092; &#1094; &#1095; &#1096; &#1097; &#1098; &#1099;
> &#1100; &#1101; &#1102; &#1103; &#8470; &#1105; &#1106; &#1107; &#1108;
> &#1109; &#1110; &#1111; &#1112; &#1113; &#1114; &#1115; &#1116; &#1118;
> &#1119; &#1548; &#1563; &#1567; &#1569; &#1570; &#1571; &#1572; &#1573;
> &#1574; &#1575; &#1576; &#1577; &#1578; &#1579; &#1580; &#1581; &#1582;
> &#1583; &#1584; &#1585; &#1586; &#1587; &#1588; &#1589; &#1590; &#1591;
> &#1592; &#1593; &#1594; &#1600; &#1601; &#1602; &#1603; &#1604; &#1605;
> &#1606; &#1607; &#1608; &#1609; &#1610; &#1611; &#1612; &#1613; &#1614;
> &#1615; &#1616; &#1617; &#1618; &lsquo; &#900; &#901; &#902; &#904; &#905;
> &#906; &#908; &#910; &#911; &#912; &alpha; &beta; &gamma; &delta;
> &epsilon;
> &zeta; &eta; &theta; &iota; &kappa; &lambda; &mu; &nu; &xi; &omicron; &pi;
> &rho; &sigma; &tau; &upsilon; &phi; &chi; &psi; &omega; &#938; &#939;
> &#940;
> &#941; &#942; &#943; &#944; &alpha; &beta; &gamma; &delta; &epsilon;
> &zeta;
> &eta; &theta; &iota; &kappa; &lambda; &mu; &nu; &xi; &omicron; &pi; &rho;
> &sigmaf; &sigma; &tau; &upsilon; &phi; &chi; &psi; &omega; &#970; &#971;
> &#972; &#973; &#974; &#8215; &#1488; &#1489; &#1490; &#1491; &#1492;
> &#1493;
> &#1494; &#1495; &#1496; &#1497; &#1498; &#1499; &#1500; &#1501; &#1502;
> &#1503; &#1504; &#1505; &#1506; &#1507; &#1508; &#1509; &#1510; &#1511;
> &#1512; &#1513; &#1514; &lrm; &rlm; &#286; &#304; &#287; &#305; &copy;
> &reg;
> &trade;
> </font>
> Thanks & Regards
> Avadhut K
>
> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On Behalf Of Paulo
> Soares
> Sent: Monday, April 16, 2007 7:22 PM
> To: Post all your questions about iText here
> Subject: Re: [iText-questions] Change encoding of font
>
>
>
>> -----Original Message-----
>> From: [hidden email]
>> [mailto:[hidden email]] On
>> Behalf Of Sascha Fuchs
>> Sent: Monday, April 16, 2007 10:09 AM
>> To: Post all your questions about iText here
>> Subject: [iText-questions] Change encoding of font
>>
>> Hello Paolo Soares,
>>
>> Hello all
>>
>>
>>
>> Thank you Paolo for your helping hint for reducing redundant
>> font embedding with BaseFont.getDocumentFonts() and replace
>> the FontFile2. It works well (font looks same even font is
>> not installed on local computer) and reduces a lot of needed
>> disk space (factor 10 or more - depending on number of pages).
>>
>>
>>
>> But we need to reduce more disk space (but the font embedding
>> should be kept).
>>
>> To reduce the needed disk space of a PDF document we want to
>> change the encoding of embedded font from ASCIIHexDecode (not
>
> You have a PDF producer that doesn't compress fonts? Amazing.
>
>> very memory efficient encoding - 40% overhead) to another,
>> like LZWDecode.
>>
>
> FlateDecode.
>
>>
>>
>> I see following two possible ways to solve the problem:
>>
>> 1: Get the stream of the font 'embedding' (I know how to) ->
>> get the decoded data (I guess with
>> PdfReader.ASCIIHexDecode(byte-array-of-stream) ) -> encode
>> the data to more 'efficient' encoding (I don't know how to)
>> -> replace old stream (I guess I know how)
>>
>> 2: Get the stream of the font 'embedding' (I know how to) ->
>> get the decoded data (I guess with
>> PdfReader.ASCIIHexDecode(byte-array-of-stream) ) -> create a
>> new font with decoded data as font embedding and encoding (I
>> don't' know how - I guess with instance of BaseFont) ->
>> replace the FontFile2 (now I know how to)...
>>
>> Can somebody help me?
>>
>
> You have methods in PdfReader to get the stream content and that already
> returns uncompressed. Create a PdfStream with that and replace it in the
> apropriate place.
>
> Paulo
>
>
> Aviso Legal:
> Esta mensagem i destinada exclusivamente ao destinatario. Pode conter
> informagco confidencial ou legalmente protegida. A incorrecta transmissco
> desta mensagem nco significa a perca de confidencialidade. Se esta
> mensagem
> for recebida por engano, por favor envie-a de volta para o remetente e
> apague-a do seu sistema de imediato. I proibido a qualquer pessoa que nco
> o
> destinatario de usar, revelar ou distribuir qualquer parte desta mensagem.
>
> Disclaimer:
> This message is destined exclusively to the intended receiver. It may
> contain confidential or legally protected information. The incorrect
> transmission of this message does not mean the loss of its
> confidentiality.
> If this message is received by mistake, please send it back to the sender
> and delete it from your system immediately. It is forbidden to any person
> who is not the intended receiver to use, distribute or copy any part of
> this
> message.


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
iText-questions mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Reg special chars

Avadhut Karambelkar
Yes I had seen the same but still my issue is not resolved
I could not see some of the characters
I think Arial font is already registered in Factory
Can you tell me how to do it as I am registering all the fonts from font dir
by
FontFactory.registerDirectory(fontDir);

-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Paulo
Soares
Sent: Tuesday, April 17, 2007 12:54 PM
To: Post all your questions about iText here
Subject: Re: [iText-questions] Change encoding of font

That was already answered.

Paulo

----- Original Message -----
From: "Avadhut Karambelkar" <[hidden email]>
To: "'Post all your questions about iText here'"
<[hidden email]>
Sent: Tuesday, April 17, 2007 4:57 AM
Subject: Re: [iText-questions] Change encoding of font


> HI all
> I have also the problem of font
> I have following HTML text in file which I am trying to convert in PDF
> But it doesn't work out can u help  me PLZ
> <font face="arial">
> &#260; &#274; &#290; &#298; &#296; &#310; &sect; &#315; &#272; &scaron;
> &#358; &shy; &#362; &#330; &deg; &#261; &#275; &#291; &#299; &#297; &#311;
> &middot; &#316; &#273; &#359; &#8213; &#363; &#331; &#256; &aacute;
> &acirc;
> &atilde; &auml; &aring; &aelig; &#302; &#268; &eacute; &#280; &euml;
> &#278;
> &iacute; &icirc; &iuml; &eth; &#325; &#332; &oacute; &ocirc; &otilde;
> &ouml;
> &#360; &oslash; &#370; &uacute; &ucirc; &uuml; &yacute; &thorn; &szlig;
> &#257; &atilde; &auml; &aring; &aelig; &#303; &#269; &eacute; &#281;
> &euml;
> &#279; &iacute; &icirc; &iuml; &eth; &#326; &#333; &oacute; &ocirc;
> &otilde;
> &ouml; &#361; &oslash; &#371; &uacute; &ucirc; &uuml; &yacute; &thorn;
> &#312; &rdquo; &cent; &pound; &curren; &bdquo; &brvbar; &oslash; &copy;
> &#342; &laquo; &not; &reg; &plusmn; &sup2; &sup3; &ldquo; &micro; &para;
> &sup1; &#343; &raquo; &frac14; &frac12; &frac34; &#262; &#377; &#323;
> &times; &#321; &#346; &#379; &#263; &#378; &#324; &divide; &#322; &#347;
> &#380; &rsquo; &pound; &#266; &#267; &#7808; &copy; &#7810; &#7922; &reg;
> &yuml;&nbsp; &#288; &#289; &para; &#7809; &#7811; &#7923; &#7812; &#7813;
> &agrave; &ccedil; &egrave; &ecirc; &igrave; &#372; &ntilde; &ograve;
> &ugrave; &#374; &agrave; &ccedil; &egrave; &ecirc; &igrave; &#373;
> &ntilde;
> &ograve; &ugrave; &#375; &yuml; &iexcl; &euro; &yen; &ordf; &macr; &ordm;
> &oelig; &oelig; &yuml; &iquest; &agrave; &ccedil; &egrave; &ecirc;
> &igrave;
> &ntilde; &ograve; &ugrave; &agrave; &ccedil; &egrave; &ecirc; &igrave;
> &ntilde; &ograve; &ugrave; &yuml; &iexcl; &yen; &uml; &ordf; &macr;
> &acute;
> &cedil; &ordm; &iquest; &agrave; &ccedil; &egrave; &ecirc; &igrave;
> &ntilde;
> &ograve; &ugrave; &ccedil; &egrave; &ecirc; &igrave; &ntilde; &ograve;
> &ugrave; &#728; &#317; &uml; &#350; &#356; &#731; &acute; &#318; &#711;
> &cedil; &#351; &#357; &#733; &#340; &#258; &#313; &#282; &#270; &#327;
> &#336; &#344; &#366; &#368; &#354; &#341; &#259; &#314; &#283; &#271;
> &#328;
> &#337; &#345; &#367; &#369; &#355; &#729; &#294; &#728; &#292; &uml;
> &#304;
> &#350; &#286; &#308; &#295; &acute; &#293; &cedil; &#305; &#351; &#287;
> &#309; &#264; &#284; &#364; &#348; &#265; &#285; &#365; &#349; &#729;
> &uml;
> &#731; &acute; &#711; &cedil; &#729; &#1025; &#1026; &#1027; &#1028;
> &#1029;
> &#1030; &#1031; &#1032; &#1033; &#1034; &#1035; &#1036; &#1038; &#1039;
> &#1040; &#1041; &#1042; &#1043; &#1044; &#1045; &#1046; &#1047; &#1048;
> &#1049; &#1050; &#1051; &#1054; &#1055; &#1056; &#1057; &#1058; &#1059;
> &#1060; &#1062; &#1063; &#1064; &#1065; &#1066; &#1067; &#1068; &#1069;
> &#1070; &#1071; &#1072; &#1073; &#1074; &#1075; &#1076; &#1077; &#1078;
> &#1079; &#1080; &#1081; &#1082; &#1083; &#1086; &#1087; &#1088; &#1089;
> &#1090; &#1091; &#1092; &#1094; &#1095; &#1096; &#1097; &#1098; &#1099;
> &#1100; &#1101; &#1102; &#1103; &#8470; &#1105; &#1106; &#1107; &#1108;
> &#1109; &#1110; &#1111; &#1112; &#1113; &#1114; &#1115; &#1116; &#1118;
> &#1119; &#1548; &#1563; &#1567; &#1569; &#1570; &#1571; &#1572; &#1573;
> &#1574; &#1575; &#1576; &#1577; &#1578; &#1579; &#1580; &#1581; &#1582;
> &#1583; &#1584; &#1585; &#1586; &#1587; &#1588; &#1589; &#1590; &#1591;
> &#1592; &#1593; &#1594; &#1600; &#1601; &#1602; &#1603; &#1604; &#1605;
> &#1606; &#1607; &#1608; &#1609; &#1610; &#1611; &#1612; &#1613; &#1614;
> &#1615; &#1616; &#1617; &#1618; &lsquo; &#900; &#901; &#902; &#904; &#905;
> &#906; &#908; &#910; &#911; &#912; &alpha; &beta; &gamma; &delta;
> &epsilon;
> &zeta; &eta; &theta; &iota; &kappa; &lambda; &mu; &nu; &xi; &omicron; &pi;
> &rho; &sigma; &tau; &upsilon; &phi; &chi; &psi; &omega; &#938; &#939;
> &#940;
> &#941; &#942; &#943; &#944; &alpha; &beta; &gamma; &delta; &epsilon;
> &zeta;
> &eta; &theta; &iota; &kappa; &lambda; &mu; &nu; &xi; &omicron; &pi; &rho;
> &sigmaf; &sigma; &tau; &upsilon; &phi; &chi; &psi; &omega; &#970; &#971;
> &#972; &#973; &#974; &#8215; &#1488; &#1489; &#1490; &#1491; &#1492;
> &#1493;
> &#1494; &#1495; &#1496; &#1497; &#1498; &#1499; &#1500; &#1501; &#1502;
> &#1503; &#1504; &#1505; &#1506; &#1507; &#1508; &#1509; &#1510; &#1511;
> &#1512; &#1513; &#1514; &lrm; &rlm; &#286; &#304; &#287; &#305; &copy;
> &reg;
> &trade;
> </font>
> Thanks & Regards
> Avadhut K
>
> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On Behalf Of Paulo
> Soares
> Sent: Monday, April 16, 2007 7:22 PM
> To: Post all your questions about iText here
> Subject: Re: [iText-questions] Change encoding of font
>
>
>
>> -----Original Message-----
>> From: [hidden email]
>> [mailto:[hidden email]] On
>> Behalf Of Sascha Fuchs
>> Sent: Monday, April 16, 2007 10:09 AM
>> To: Post all your questions about iText here
>> Subject: [iText-questions] Change encoding of font
>>
>> Hello Paolo Soares,
>>
>> Hello all
>>
>>
>>
>> Thank you Paolo for your helping hint for reducing redundant
>> font embedding with BaseFont.getDocumentFonts() and replace
>> the FontFile2. It works well (font looks same even font is
>> not installed on local computer) and reduces a lot of needed
>> disk space (factor 10 or more - depending on number of pages).
>>
>>
>>
>> But we need to reduce more disk space (but the font embedding
>> should be kept).
>>
>> To reduce the needed disk space of a PDF document we want to
>> change the encoding of embedded font from ASCIIHexDecode (not
>
> You have a PDF producer that doesn't compress fonts? Amazing.
>
>> very memory efficient encoding - 40% overhead) to another,
>> like LZWDecode.
>>
>
> FlateDecode.
>
>>
>>
>> I see following two possible ways to solve the problem:
>>
>> 1: Get the stream of the font 'embedding' (I know how to) ->
>> get the decoded data (I guess with
>> PdfReader.ASCIIHexDecode(byte-array-of-stream) ) -> encode
>> the data to more 'efficient' encoding (I don't know how to)
>> -> replace old stream (I guess I know how)
>>
>> 2: Get the stream of the font 'embedding' (I know how to) ->
>> get the decoded data (I guess with
>> PdfReader.ASCIIHexDecode(byte-array-of-stream) ) -> create a
>> new font with decoded data as font embedding and encoding (I
>> don't' know how - I guess with instance of BaseFont) ->
>> replace the FontFile2 (now I know how to)...
>>
>> Can somebody help me?
>>
>
> You have methods in PdfReader to get the stream content and that already
> returns uncompressed. Create a PdfStream with that and replace it in the
> apropriate place.
>
> Paulo
>
>
> Aviso Legal:
> Esta mensagem i destinada exclusivamente ao destinatario. Pode conter
> informagco confidencial ou legalmente protegida. A incorrecta transmissco
> desta mensagem nco significa a perca de confidencialidade. Se esta
> mensagem
> for recebida por engano, por favor envie-a de volta para o remetente e
> apague-a do seu sistema de imediato. I proibido a qualquer pessoa que nco
> o
> destinatario de usar, revelar ou distribuir qualquer parte desta mensagem.
>
> Disclaimer:
> This message is destined exclusively to the intended receiver. It may
> contain confidential or legally protected information. The incorrect
> transmission of this message does not mean the loss of its
> confidentiality.
> If this message is received by mistake, please send it back to the sender
> and delete it from your system immediately. It is forbidden to any person
> who is not the intended receiver to use, distribute or copy any part of
> this
> message.


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
iText-questions mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
iText-questions mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Reg special chars

Paulo Soares
If you don't see all maybe Arial doesn't have all. Try with
arialuni.ttf.

Paulo

> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On
> Behalf Of Avadhut Karambelkar
> Sent: Tuesday, April 17, 2007 9:53 AM
> To: 'Post all your questions about iText here'
> Subject: Re: [iText-questions] Reg special chars
>
> Yes I had seen the same but still my issue is not resolved
> I could not see some of the characters
> I think Arial font is already registered in Factory
> Can you tell me how to do it as I am registering all the
> fonts from font dir
> by
> FontFactory.registerDirectory(fontDir);

Aviso Legal:
Esta mensagem é destinada exclusivamente ao destinatário. Pode conter informação confidencial ou legalmente protegida. A incorrecta transmissão desta mensagem não significa a perca de confidencialidade. Se esta mensagem for recebida por engano, por favor envie-a de volta para o remetente e apague-a do seu sistema de imediato. É proibido a qualquer pessoa que não o destinatário de usar, revelar ou distribuir qualquer parte desta mensagem.

Disclaimer:
This message is destined exclusively to the intended receiver. It may contain confidential or legally protected information. The incorrect transmission of this message does not mean the loss of its confidentiality. If this message is received by mistake, please send it back to the sender and delete it from your system immediately. It is forbidden to any person who is not the intended receiver to use, distribute or copy any part of this message.



-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
iText-questions mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Reg special chars

Avadhut Karambelkar
I tried same arialuni also but not working
Is it because of Encoding type cause I checked in one of pdf which is
already created and it is showing as encoding=IDENTITY-H
If it is then how can put encoding in pdf
As that is coming form HTML file

-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Paulo
Soares
Sent: Tuesday, April 17, 2007 2:22 PM
To: Post all your questions about iText here
Subject: Re: [iText-questions] Reg special chars

If you don't see all maybe Arial doesn't have all. Try with
arialuni.ttf.

Paulo

> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On
> Behalf Of Avadhut Karambelkar
> Sent: Tuesday, April 17, 2007 9:53 AM
> To: 'Post all your questions about iText here'
> Subject: Re: [iText-questions] Reg special chars
>
> Yes I had seen the same but still my issue is not resolved
> I could not see some of the characters
> I think Arial font is already registered in Factory
> Can you tell me how to do it as I am registering all the
> fonts from font dir
> by
> FontFactory.registerDirectory(fontDir);


Aviso Legal:
Esta mensagem i destinada exclusivamente ao destinatario. Pode conter
informagco confidencial ou legalmente protegida. A incorrecta transmissco
desta mensagem nco significa a perca de confidencialidade. Se esta mensagem
for recebida por engano, por favor envie-a de volta para o remetente e
apague-a do seu sistema de imediato. I proibido a qualquer pessoa que nco o
destinatario de usar, revelar ou distribuir qualquer parte desta mensagem.

Disclaimer:
This message is destined exclusively to the intended receiver. It may
contain confidential or legally protected information. The incorrect
transmission of this message does not mean the loss of its confidentiality.
If this message is received by mistake, please send it back to the sender
and delete it from your system immediately. It is forbidden to any person
who is not the intended receiver to use, distribute or copy any part of this
message.




-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
iText-questions mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/
Loading...