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
JSP - A mailing list about Java Server Pages specification and reference
J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition
J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog
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
Subject: Servlet : Session invalidate
Oracle Connection Pooling in 3 2 2
Servlet action is currently unavailable
Tomcat/Struts Unicode Encoding/Decoding problems
Subject: Running a Simple JMS Example
Tomcat and webapplication specific java library path
Mapping in workers2 properties
org apache jasper JasperException
problem with html:text bean throwing exception
Cannot find message resources under key org apache struts action
   MESSAGE
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
Value attribute of <html:checkbox
url string for connecting jboss to oracle
javax servlet ServletException: BeanUtils populate
5 0 18: Windows XP Pro vs Windows 2000
HTTP Status 404 The requested resource is not available
 
Subject: Re: pdf conversion from html

Subject: Re: pdf conversion from html

2007-11-06       - By nsk clr

 Back
Hi Paulo

Thanks for your reply. I'll write code to remove the font tags & style tags.

What shall I do about the wide images that are in the html, which are displayed
truncated in pdf.

Thanks



From: Paulo Soares <psoares <at> consiste.pt>

Subject: Re: pdf conversion from html

Newsgroups: gmane.comp.java.lib.itext.general

Date: 2007-11-06 08:59:25 GMT
(8 hours and 36 minutes ago)

You are setting the encoding for all the html and are selecting a font
afterwards that doesn't support it. If it's not the case post the html that
causes the problem.

Paulo

-- -- Original Message -- --
From: "nsk clr" <nskclr <at> yahoo.com>
To: <itext-questions <at> lists.sourceforge.net>
Sent: Tuesday, November 06, 2007 12:05 AM
Subject: [iText-questions] pdf conversion from html

> Hi
>
> I use 'Arial Unicode MS' with 'Identity-H' encoding to convert Html to
> pdf.
>   Document document = new Document();
>   FontFactory.register("C:\\Windows\\fonts\\arialuni.ttf");
>   StyleSheet st = new StyleSheet();
>   st.loadTagStyle("body", "face", "Arial Unicode MS");
>   st.loadTagStyle("body", "encoding", "Identity-H");
>   st.loadTagStyle("body", "leading", "12,0");
>
>   document.open();
>   ArrayList p = HTMLWorker.parseToList(stringReader, st);
>   for (int k = 0; k < p.size(); ++k) {
>    document.add((Element)p.get(k));
>   }
>   document.close();
>
> In some cases, If the html has font tag and style tag with font (eg. <span
> style="FONT-WEIGHT: bold; COLOR: rgb(0,153,204)">), I get the following
> exception.
> ExceptionConverter: java.io.UnsupportedEncodingException: Identity-H
>
> Also when I convert the html with image, the image fills the page
> widthwise and is truncated on the sides. what should i include for images?
>
> Thanks

-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -----
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
__ ____ ____ ____ ____ ____ ____ ____ ____ ____
iText-questions mailing list
iText-questions <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/





__ ____ ____ ____ ____ ____ ____ ____ ____ ____ __
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head>
<body><div style="font-family:times new roman, new york, times, serif;font-size
:12pt"><div>Hi Paulo<br><br>Thanks for your reply. I'll write code to remove the
font tags &amp; style tags.<br><br>What shall I do about the wide images that
are in the html, which are displayed truncated in pdf.<br><br>Thanks<br><br><br
>
From: Paulo Soares &lt;psoares &lt;at&gt; consiste.pt&gt;<br>
Subject: <a target="_top" rel="nofollow" href="http://news.gmane.org/find-root
.php?message_id=%3c005101c82053%2457f5a570%24587ba8c0%40psoaresw%3e">Re: pdf
conversion from html</a><br>
Newsgroups: <a href="http://news.gmane.org/gmane.comp.java.lib.itext.general"
target="_top">gmane.comp.java.lib.itext.general</a><br>
Date: 2007-11-06 08:59:25 GMT
(8 hours and 36 minutes ago)<br>
<pre>You are setting the encoding for all the html and are selecting a font <br
>afterwards that doesn't support it. If it's not the case post the html that <br
>causes the problem.<br><br>Paulo<br><br>-- -- Original Message -- -- <br>From:
"nsk clr" &lt;nskclr &lt;at&gt; yahoo.com&gt;<br>To: &lt;itext-questions &lt;at
&gt; lists.sourceforge.net&gt;<br>Sent: Tuesday, November 06, 2007 12:05 AM<br
>Subject: [iText-questions] pdf conversion from html<br><br>&gt; Hi<br>&gt;<br>
&gt; I use 'Arial Unicode MS' with 'Identity-H' encoding to convert Html to <br>
&gt; pdf.<br>&gt;   Document document = new Document();<br>&gt;   FontFactory
.register("C:\\Windows\\fonts\\arialuni.ttf");<br>&gt;   StyleSheet st = new
StyleSheet();<br>&gt;   st.loadTagStyle("body", "face", "Arial Unicode MS");<br
>&gt;   st.loadTagStyle("body", "encoding", "Identity-H");<br>&gt;   st
.loadTagStyle("body", "leading", "12,0");<br>&gt;<br>&gt;   document.open();<br>
&gt;   ArrayList p =
HTMLWorker.parseToList(stringReader, st);<br>&gt;   for (int k = 0; k &lt; p
.size(); ++k) {<br>&gt;    document.add((Element)p.get(k));<br>&gt;   }<br>&gt;
 document.close();<br>&gt;<br>&gt; In some cases, If the html has font tag and
style tag with font (eg. &lt;span <br>&gt; style="FONT-WEIGHT: bold; COLOR: rgb
(0,153,204)"&gt;), I get the following <br>&gt; exception.<br>&gt;
ExceptionConverter: java.io.UnsupportedEncodingException: Identity-H<br>&gt;<br
>&gt; Also when I convert the html with image, the image fills the page <br>&gt;
widthwise and is truncated on the sides. what should i include for images?<br>
&gt;<br>&gt; Thanks<br><br>-- ---- ---- ---- ---- ---- ---- ---- ---- ---- -----
-- ---- ---- ---- --<br>This SF.net email is sponsored by: Splunk Inc.<br>Still
grepping through log files to find problems?  Stop.<br>Now Search log events
and configuration files using AJAX and a browser.<br>Download your FREE copy of
Splunk now &gt;&gt; <a
rel="nofollow" href="http://get.splunk.com/" target="_top">http://get.splunk
.com/</a><br>__ ____ ____ ____ ____ ____ ____ ____ ____ ____<br>iText-questions
mailing list<br>iText-questions &lt;at&gt; lists.sourceforge.net<br><a rel=
"nofollow" href="https://lists.sourceforge.net/lists/listinfo/itext-questions"
target="_top">https://lists.sourceforge.net/lists/listinfo/itext-questions</a>
<br>Buy the iText book: <a rel="nofollow" href="http://itext.ugent.be/itext-in
-action/" target="_top">http://itext.ugent.be/itext-in-action/</a><br><br></pre>
<br></div></div><br>__ ____ ____ ____ ____ ____ ____ ____ ____ ____ __<br>Do You
Yahoo!?<br>Tired of spam?  Yahoo! Mail has the best spam protection around <br
>http://mail.yahoo.com </body></html>
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -----
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
__ ____ ____ ____ ____ ____ ____ ____ ____ ____
iText-questions mailing list
iText-questions@(protected)
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

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