Forum Replies Created
-
AuthorPosts
-
in reply to: display current date every time the PDF is opened January 24, 2012 at 11:51in reply to: pd4ml in a .jspx file used with success – up to a point …. January 24, 2012 at 13:58#28755
I have the latest version of pd4ml 3.8.0
Here’s the code (just change enable to “true” and it produces a .pdf, but with enable=”false” I get the exception):
<root xmlns:pd4ml="http://pd4ml.com/tlds/pd4ml/2.6"<br /> xmlns:jsp="http://java.sun.com/JSP/Page"<br /> xmlns:c="http://java.sun.com/jsp/jstl/core"><pd4ml:transform enable="false"<br /> pageFormat="A4"<br /> pageOrientation="Portrait"<br /> screenWidth="610"<br /> pageInsets="10,50,20,50,points"<br /> enableTableBreaks="true"<br /> inline="false"<br /> fileName="hello.pdf"<br /> debug="true"><pd4ml:usettf from="java:fonts" serif="Times New Roman" sansserif="Arial" monospace="Courier New"/><pd4ml:permissions password="empty" rights="2068" strongEncryption="false"/><html xmlns:html="http://www.w3.org/1999/xhtml"<br /> xmlns:tiles="http://tiles.apache.org/tags-tiles"<br /> xmlns:form="http://www.springframework.org/tags/form"<br /> xmlns:spring="http://www.springframework.org/tags"<br /> xmlns:roo="urn:jsptagdir:/WEB-INF/tags"<br /> xmlns:security="http://www.springframework.org/security/tags" version="2.0"><br /> <jsp:output doctype-root-element="HTML" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"<br /> doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml-strict.dtd"/><br /> <jsp:directive.page contentType="text/html;charset=UTF-8" /><br /> <jsp:directive.page pageEncoding="UTF-8" /><br /> <head><br /> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><br /> <meta http-equiv="X-UA-Compatible" content="IE=8" /><br /> <link rel="stylesheet" href="/contabilita/css/int/general.css" type="text/css"/><br /> <link rel="stylesheet" href="/contabilita/css/int/header.css" type="text/css"/><br /> <script type="text/javascript" src="/javascript/mootools141.js"><!-- required by FF and opera --></script><br /> <title>A title</title><br /> </head><br /> <br /> <body><br /> <div id="wrapperVit"><br /> <tiles:insertAttribute name="header" ignore="true" /><br /> <div id="main" style="padding-top: 10px;"><br /> <tiles:insertAttribute name="body"/><br /> </div><br /> </div><br /> </body><br /> <br /> <br /> </html><br /> <br /> <br /> </pd4ml:transform><br /> <br /> </root>
in reply to: pd4ml in a .jspx file used with success – up to a point …. January 24, 2012 at 14:09#28756OK, now try to substitute all occurrences of “pd4ml:” with “pd4mlXXX”, try to open the page in a web browser and open the generated HTML document source.
Are there any whitespaces before
? in reply to: HTML/CSS rendering issues January 24, 2012 at 14:10#26660Hi all!
When using style definitions
<br /> .element {<br /> width: 45%;<br /> }<br /> .element.full {<br /> width: 100%;<br /> }
in div element as following
<div class="element full" style="border: 1px solid black;">
causes the div to gain width of 45% instead of 100%. If width attribute is removed from .element or .element.full is renamed to .full then div gains 100% width. Is this kind style inheritance unsupported in pd4ml?Thanks in advance,
Kallein reply to: Troubleshooting January 24, 2012 at 15:49#26662I have run into an issue ‘upgrading’ from pd4ml 3.70fx2 to 3.8. I am using the Pro evaluation verions. I am using TTF fonts and what worked in 3.7 no longer does in 3.8. I am using just a basic Java app rendering a test html page. Both are attached. Changing only the pd4ml library, the ‘Arial Narrow MT’ font now renders as plain Arial.
Debug output:
version: PD4ML 370fx2 Pro (eval)
not yet in cache: java:tifonts/pd4fonts.properties
not yet in cache: java:tifonts/Arial.ttf
read ‘arial’ from java:tifonts/Arial.ttf
not yet in cache: java:tifonts/Arial Bold.ttf
read ‘arial bold’ from java:tifonts/Arial Bold.ttf
not yet in cache: java:tifonts/Arial Italic.ttf
read ‘arial italic’ from java:tifonts/Arial Italic.ttf
not yet in cache: java:tifonts/Arial Bold Italic.ttf
read ‘arial bold italic’ from java:tifonts/Arial Bold Italic.ttf
not yet in cache: java:tifonts/ArialNarrow.ttf
read ‘arial narrow mt’ from java:tifonts/ArialNarrow.ttf
not yet in cache: java:tifonts/ArialNarrow-Bold.ttf
read ‘arial narrow mt bold’ from java:tifonts/ArialNarrow-Bold.ttf
not yet in cache: java:tifonts/ArialNarrow-Italic.ttf
read ‘arial narrow mt italic’ from java:tifonts/ArialNarrow-Italic.ttf
not yet in cache: java:tifonts/ArialNarrow-BoldItalic.ttf
read ‘arial narrow mt bold italic’ from java:tifonts/ArialNarrow-BoldItalic.ttf
not yet in cache: java:tifonts/Franklin Gothic Medium.ttf
read ‘franklin gothic medium’ from java:tifonts/Franklin Gothic Medium.ttf
‘franklin gothic medium bold’ is not in pd4fonts.properties file
reject TTF lookup for: ‘franklin gothic medium bold’
not yet in cache: java:tifonts/Franklin Gothic Medium Italic.ttf
read ‘franklin gothic medium italic’ from java:tifonts/Franklin Gothic Medium Italic.ttf
‘franklin gothic medium bold italic’ is not in pd4fonts.properties file
reject TTF lookup for: ‘franklin gothic medium bold italic’
‘courier new’ is not in pd4fonts.properties file
reject TTF lookup for: ‘courier new’
done in 863ms.version: PD4ML 380 Pro (eval)
not yet in cache: java:tifonts/pd4fonts.properties
not yet in cache: java:tifonts/Arial.ttf
read ‘arial’ from java:tifonts/Arial.ttf
‘courier new’ is not in pd4fonts.properties file
reject TTF lookup for: ‘courier new’
‘ms gothic’ is not in pd4fonts.properties file
reject TTF lookup for: ‘ms gothic’
‘mingliu’ is not in pd4fonts.properties file
reject TTF lookup for: ‘mingliu’
‘simsun’ is not in pd4fonts.properties file
reject TTF lookup for: ‘simsun’
‘mangal’ is not in pd4fonts.properties file
reject TTF lookup for: ‘mangal’
‘david’ is not in pd4fonts.properties file
reject TTF lookup for: ‘david’
‘gulimche’ is not in pd4fonts.properties file
reject TTF lookup for: ‘gulimche’
‘wingdings’ is not in pd4fonts.properties file
reject TTF lookup for: ‘wingdings’
‘symbol’ is not in pd4fonts.properties file
reject TTF lookup for: ‘symbol’
‘lucida sans regular’ is not in pd4fonts.properties file
reject TTF lookup for: ‘lucida sans regular’
not yet in cache: java:tifonts/Franklin Gothic Medium.ttf
read ‘franklin gothic medium’ from java:tifonts/Franklin Gothic Medium.ttf
‘franklin gothic medium bold’ is not in pd4fonts.properties file
reject TTF lookup for: ‘franklin gothic medium bold’
not yet in cache: java:tifonts/Franklin Gothic Medium Italic.ttf
read ‘franklin gothic medium italic’ from java:tifonts/Franklin Gothic Medium Italic.ttf
‘franklin gothic medium bold italic’ is not in pd4fonts.properties file
reject TTF lookup for: ‘franklin gothic medium bold italic’
done in 851ms.Here is the simple html file:
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><br /> <head><br /> <title>TI</title><br /> <style type="text/css"><br /> *{font-family:"Arial";font-size:12px;vertical-align: top;}<br /> </style><br /> </head><br /> <body><br /> Default font<br><br><br /> <div style="font-family:'Arial';">Arial</div><br /> <div style="font-family:'Arial';font-weight:bold;">Arial Bold</div><br /> <div style="font-family:'Arial';font-style:italic">Arial Italic</div><br /> <div style="font-family:'Arial';font-weight:bold;font-style:italic">Arial Bold Italic</div><br /> <br><br /> <div style="font-family:'Arial Narrow MT';">Arial Narrow</div><br /> <div style="font-family:'Arial Narrow MT';font-weight:bold;">Arial Narrow Bold</div><br /> <div style="font-family:'Arial Narrow MT';font-style:italic">Arial Narrow Italic</div><br /> <div style="font-family:'Arial Narrow MT';font-weight:bold;font-style:italic">Arial Narrow Bold Italic</div><br /> <br><br /> <div style="font-family:'Franklin Gothic Medium';">Franklin Gothic Medium</div><br /> <div style="font-family:'Franklin Gothic Medium';font-weight:bold;">Franklin Gothic Medium Bold</div><br /> <div style="font-family:'Franklin Gothic Medium';font-style:italic">Franklin Gothic Medium Italic</div><br /> <div style="font-family:'Franklin Gothic Medium';font-weight:bold;font-style:italic">Franklin Gothic Medium Bold Italic</div><br /> </body><br /> </html>
and the properties file:
#Mon Jan 23 14:51:00 EST 2012
Franklin Gothic Medium=Franklin Gothic Medium.ttf
Franklin Gothic Medium Italic=Franklin Gothic Medium Italic.ttf
Arial=Arial.ttf
Arial Bold=Arial Bold.ttf
Arial Bold Italic=Arial Bold Italic.ttf
Arial Italic=Arial Italic.ttf
Arial Narrow MT=ArialNarrow.ttf
Arial Narrow MT Bold=ArialNarrow-Bold.ttf
Arial Narrow MT Bold Italic=ArialNarrow-BoldItalic.ttf
Arial Narrow MT Italic=ArialNarrow-Italic.ttfI’d appreciate any help. Thanks.
— Cindy
in reply to: General questions / FAQ January 25, 2012 at 05:20#26663I am using the pd4ml jsp taglibs to generate a PDF file. The PDF file loads well, but when trying to save tus file, the de default file extensión is jsp. If i manually write the .pdf extensión to the file, i get an error when trying to open it and i cant open it because the format is incorrect.
in reply to: TTF issues Pro Eval Version 3.8 vs 3.7 January 26, 2012 at 13:37#28821We’ve just published a new version of PD4ML, which also addresses some TTF substitution issues. Please give it a try and let us know if it solves the problem on your side.
in reply to: display current date every time the PDF is opened January 26, 2012 at 13:48#28788We successfully prototyped the feature and were able to auto-insert the date info into a form field. Unfortunately we did not enabled the feature in the just-released v380fx2, as there was not enough time to extensively test it. It is going to be available with the next beta-release of PD4ML.
FYI: we achieved that with
[language=Java:11vnygw9]this.getField(“i1”).value = new Date().toDateString()[/language:11vnygw9]
JavaScript code, assigned to OpenAction of PDF.The source HTML document supposed to define:
[language=xml:11vnygw9][/language:11vnygw9]PD4ML must explicitly enable PDF form output:
[language=java:11vnygw9]pd4ml.generatePdfForms(true, null);[/language:11vnygw9]in reply to: General questions / FAQ January 26, 2012 at 14:37#26664Using the PM4ML API can we generate the editable pdf form from html and after that user should able to save the contents of the pdf form.
Thanks
Suri
7325992404.in reply to: HTML/CSS rendering issues January 26, 2012 at 18:51#26665Hi there,
I dropped down PD4ml to evaluate today for my company for a project we are doing. I am converting an HTML page generated by xsl and everything is working brilliantly. However, I have one issue. I can not get images to render in the PDF.
all I get during the render is:image not yet in cache: http://chcd-images.crcpress.com/00020000-00029999/00023871.png
not yet in cache: http://chcd-images.crcpress.com/00020000-00029999/00023871.png
Connection timed out: connect: http://chcd-images.crcpress.com/00020000-00029999/00023871.png
If you paste the url into any browser you will see it appears instantly, I tried on another random image from the web and go the same problem. I wonder if you can point me in the right direction.The code I am using to generate is:
PD4ML html = new PD4ML();
html.enableDebugInfo();
html.setPageSize(new java.awt.Dimension(450, 450));
html.setPageInsets(new java.awt.Insets(20, 50, 10, 10));
html.setHtmlWidth(750);
html.enableImgSplit(false);response.setContentType(“application/pdf”);
response.setHeader(“Content-disposition”, “inline; filename=test4.pdf”);
if (!request.isSecure()) {
response.setHeader(“Pragma”, “no-cache”);
response.setHeader(“Expires”, “-10000”);
}URL base = new URL(“file:E:\temp\testarrr.jsp”);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
html.render(url, baos);byte[] result = baos.toByteArray();
response.setContentLength(result.length);ServletOutputStream sos = response.getOutputStream();
sos.write(result);in reply to: images won’t render January 26, 2012 at 20:27#28826I forgot to mention, these images are not the same site as the PDF is being generated. They are being delivered by a different one.
in reply to: display current date every time the PDF is opened January 27, 2012 at 09:07#28789thanks for the response.
So When can we excpect this new beta-release of PD4ML? Also please let me know how can we assign javascript to OpenAction of pdf programatically.
thanks.
in reply to: HTML/CSS rendering issues January 27, 2012 at 13:22#26666Hello!
After years of successfully using pd4ml for various document export, we are extending its use to export an almost arbitrary page.
One of the issues we run into is the following:“An absolutely positioned element within an anchor parent (not a link, rather the parent that the positioning eventually refers to) that has a padding on the side we position from – ie. absolute positioning from left and a left padding on the parent – will get positioned within the padding boundaries rather than the element itself.”
That behavior is different from that of all browsers I could test, who consistently relate to the element’s box disregarding the padding.
An example:
<br /> <div style="padding:0 0 0 90px;position:relative;top:0;left:0;border:2px solid black;width:50em;height:90px;"><br /> <img src="http://creativecommons.org/images/deed/cc-logo.jpg" title="This image should appear exactly in the left top corner of the parent box" style="width:80px;position:absolute;top:0;left:0;"><br /> The image should appear exactly in the left top corner of the parent box. but due to the left padding, PD4ML renders it shifted to the right by the size of the padding and the image covers this text.<br /> </div><br />
or a live link here (it can be used in the PD4ML GUI – many thanks for that tool!):
http://www.vergangen.de/permatemp/pd4mlreport/pd4ml_abspadding_forum_codesample.htmlWould that make a fixable issue?
If there was such a report already, please point me there and disregard my posting.Ah yes – the version we use is PD4ML HTML2PDF for Java, version 380fx2.
—
Best regards,
Viktorin reply to: display current date every time the PDF is opened January 27, 2012 at 13:27#28790Currently the method signature is like that:
public void addDocumentActionHandler( String actionType, String javaScript );
We’ll see during the testing if any extra parameters are needed.We could send you a development version to test closer to the end of the next week.
in reply to: images won’t render January 27, 2012 at 13:41#28827Typical reasons of the issue could be like that:
there are 3 nodes in the scenario: client browser (A), document/PD4ML server (B), images server (C).
In regular web browsing scenario A establishes a connection to B to download HTML, and after that to C to download the images.
A – B
A – CIn PD4ML scenario A only establishes a connection to B (to get PDF). In order to produce PDF B connects to C itself to load images.
A – B
B – CAs a rule A has all needed routing info and “knows” how to connect to B and to C even if there is a firewall/reverse-proxy in-between.
But very often server (B) does not know how to resolve name of image server (C), especially if the name is defined for outside world like images.corporation.com, but within intranet it is known under a paranoid cryptic name i.e. b3462346x.intranet.corporation.com; or when the C is belong to another net, and due to security policy B has no routing to C.
-
AuthorPosts