Java Mailing List Archive

http://www.junlu.com/

Google
Google
Mailing List
Home
Forum Home
JBoss - Java Application Server
Tomcat - JSP/Servlet container
Struts - A MVC web framework
iText - An open source PDF Java Library
JDOM - JDOM XML Parser
J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition
J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog
JSP - A mailing list about Java Server Pages specification and reference
Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology
Struts & Hibernate
Subjects
JSP editor plugin for eclipse ?
org apache jasper JasperException: Unable to compile class for JSP
Tomcat: Connection reset by peer: socket write error
Cannot retrieve definition for form bean null
Struts Tiles Tutorial (free Struts training)
Where do I download Tomcat 4 0 6?
Data Access Object (DAO) pattern, example DAO 's
Where to download Tomcat v 4 1 24 from?
Tomcat 5 0 16 Requested resource not available
Oracle Connection Pooling in 3 2 2
Servlet : Session invalidate
Servlet action is currently unavailable
Tomcat/Struts Unicode Encoding/Decoding problems
Tomcat and webapplication specific java library path
Running a Simple JMS Example
Mapping in workers2 properties
org apache jasper JasperException
Cannot find message resources under key org apache struts action
   MESSAGE
problem with html:text bean throwing exception
Cannot find message resources under key org apache struts action MESSAGE
invalid direct reference problem with solution
Tool for jsp debug Try Sysdeo Eclipse Plugin
Tomcat 5 Cannot load JDBC driver class 'null ' SQL state: null
weblogic ejbc
java properties file
Jboss 3 2 3 Coyote Can 't re
Tomcat 5, Apache2 and mod jk2 integration problem
JBoss example problem new to J2EE
url string for connecting jboss to oracle
Value attribute of <html:checkbox
javax servlet ServletException: BeanUtils populate
HTTP Status 404 The requested resource is not available
5 0 18: Windows XP Pro vs Windows 2000
 
2 czech Characters getting lost when parsingthrough IText

2 czech Characters getting lost when parsingthrough IText

2006-07-22       - By Paulo Soares

 Back

-- -- Original Message -- --
From: "Bela Sharma" <belaSharma@(protected)>
To: <itext-questions@(protected)>
Sent: Friday, July 21, 2006 10:47 AM
Subject: [iText-questions] 2 czech Characters getting lost when
parsingthrough IText


> Hi
> I get a strange issue with 2 of the czech characters when generating PDF
> using IText version 1.4.2.
> When customerNumber=Pr??erne ?lutouck? is sent as as input to IText  after
> doing following steps
> // Step 1: creation of a document-object
> document = new Document(PageSize.A4);
>
> // step 2: create a writer that listens to the document
> writer = PdfWriter.getInstance(document, baos);
> // step 3: we create a parser and set the document handler
>                        parser =
> SAXParserFactory.newInstance().newSAXParser();
>                        InputSource isrc = new InputSource(bais);
>                        isrc.setEncoding(getEncodingType());
>                        CustomTagHandler cth=   new
> CustomTagHandler(document, writer, getCustomMap(),"ISO-8859 (See http://ISO-8859.ora-code.com)-2");
>
>                        // step 4: we parse the document
>                        parser.parse(isrc,cth);
>                        System.out.println(" in GenericContracttoPdfconv.
> parser:"+parser.toString());
>                        // step 5: close the document object
>                        document.close();
>
> The 2 characters ? and ? are lost and we get boxes in their place.
>
> Here's the constructor for CustomTagHandler
>
> public CustomTagHandler(DocListener _doclistener, PdfWriter
> _writer,HashMap hashmap,String encoding_loc)throws DocumentException,
> IOException
>        {
>                super(_doclistener);
>
>                setStrMethodName("CustomTagHandler");  /* NOI18N */
>                fillLocaleFont();
>
>                if (encoding_loc.indexOf("-locale-") != -1){
>                        position = encoding_loc.indexOf("-locale-");
>                        System.out.println("CTH sit_loc:"+encoding_loc+"
> pos:"+position);
>                        encoding = encoding_loc.substring(0, position);
>                        locale = encoding_loc.substring(position+8);
>                        System.out.println("CTH enc:"+encoding+" locale:"
> +locale);
>                }else{
>                        encoding = encoding_loc;
>                        System.out.println("CTH enco:"+encoding);
>                }
>
>
>                filename=getFontFile(locale);
>                setBaseFont(BaseFont.createFont(filename,
> encoding,BaseFont.EMBEDDED));
>                setMyTags(hashmap);
>                setWriter(_writer);
>                setDoclistener(_doclistener);
>                setCb(_writer.getDirectContent());
>                stackThis = new java.util.Stack Source code of java.util.Stack();
>                isStackReadyForText = false;
>                leftText = null;
>                centerText = null;
>                rightText = null;
>
>
>        }
>
> Can you please guide us as to what should we do for those 2 missing
> characters.

Use a font and encoding that covers the two characters.

Paulo


-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -----
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
__ ____ ____ ____ ____ ____ ____ ____ ____ ____
iText-questions mailing list
iText-questions@(protected)
https://lists.sourceforge.net/lists/listinfo/itext-questions

©2008 junlu.com - Jax Systems, LLC, U.S.A.