Forum Replies Created
-
AuthorPosts
-
in reply to: HTML/CSS rendering issues March 20, 2012 at 13:54#26701
Hi,
I am trying to display the following html in a generated PDF:
Hello $1000
The border on the span is not being displayed.
I have a similar piece of HTML to display a border around a td in a table and this renders fine.
Any help is appreciated.
Regards
in reply to: span tag not displaying border March 20, 2012 at 16:25#28924PD4ML does not support SPAN borders. It is an implementation restriction: is interpreted as a text style changer (like , etc) and ignores some block element-specific styles.
in reply to: Troubleshooting March 22, 2012 at 14:55#26702Hi –
I’m trying to load an image tag resource and am getting an error.
invalid image URL: java:com/lyzasoft/lyza/lineage/html/resources/datatype_number_gray.png
I tried calling resource = Thread.currentThread().getContextClassLoader().getResource(resourcePath) directly and it worked.
Any ideas?
Thanks!
Davein reply to: Image with java: protocol failing March 22, 2012 at 19:19#28927I’ve also tried loading a ResourceProvider and that can’t be found either. Lastly I tried putting the images and provider class in a JAR, same result.
This is a showstopper for me so any help would be greatly appreciated.
in reply to: Image with java: protocol failing March 23, 2012 at 00:51#28928I did get the provider to load.
in reply to: Troubleshooting March 25, 2012 at 03:16#26703Hello
I cannot find out what is wrong. It seems that Basic Authentication is broken with Domino. I get the following Error
http://apps04.strong.com.do/Customers/JSD.BS/JSDBS1/DSERequest/Template/DS-EReq-NTF-01.Nsf/0/9BF0B5AA67548CF6042579CB00039C8C?OpenDocument not found.
java.net.SocketException: socket closed
at java.net.SocketInputStream.read(SocketInputStream.java:140)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:229)
at java.io.BufferedInputStream.read1(BufferedInputStream.java:269)
at java.io.BufferedInputStream.read(BufferedInputStream.java:328)
at sun.net.www.MeteredStream.read(MeteredStream.java:128)
at org.zefer.cache.e.getResourceAsBytes(Unknown Source)
at org.zefer.html.doc.PD4MLHtmlParser.parse(Unknown Source)
at org.zefer.html.doc.PD4MLHtmlParser.buildDocument(Unknown Source)
at org.zefer.pd4ml.PD4ML.o00000(Unknown Source)
at org.zefer.pd4ml.PD4ML.render(Unknown Source)
at org.zefer.pd4ml.PD4ML.render(Unknown Source)
at PdfAgent.runConverter(Unknown Source)
at PdfAgent.NotesMain(Unknown Source)
at lotus.domino.AgentBase.runNotes(Unknown Source)
at lotus.domino.NotesThread.run(Unknown Source)
java.lang.NullPointerException
at org.zefer.pd4ml.PD4ML.o00000(Unknown Source)
at org.zefer.pd4ml.PD4ML.render(Unknown Source)
at org.zefer.pd4ml.PD4ML.render(Unknown Source)
at PdfAgent.runConverter(Unknown Source)
at PdfAgent.NotesMain(Unknown Source)
at lotus.domino.AgentBase.runNotes(Unknown Source)
at lotus.domino.NotesThread.run(Unknown Source)Here is the code, of course the Username and password is correct i changed it to publish here. It works with Anonymous Manager but that would be a no go. Any Hints?
/*
* ===========================================================================
* PD4ML: HTML to PDF Converter for Java.
* DXL-to-PDF converting agent
*
* http://pd4ml.com, 2007-2008
* ===========================================================================
*/import java.awt.Dimension;
import java.awt.Insets;
import java.io.BufferedInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.StringReader;
import java.net.MalformedURLException;
import java.net.URL;import lotus.domino.*;
import java.util.HashMap;
import java.util.Map;
import org.xml.sax.SAXException;
import org.zefer.pd4ml.PD4Constants;
import org.zefer.pd4ml.PD4ML;
import org.zefer.pd4ml.PD4PageMark;public class PdfAgent extends AgentBase {
private final static String xslName = “dxl4pd4ml.xsl”;
/* configuration switch: XSL location */
private final static boolean readXslFromJar = true;private final static String xslDocumentFormName = “XSL4PD4ML”;
private final static String xslDocumentFieldName = “XSLT”;
protected Dimension format = PD4Constants.A4;protected boolean landscapeValue = false;
protected int topValue = 10;
protected int leftValue = 10;
protected int rightValue = 10;
protected int bottomValue = 10;
protected String unitsValue = “mm”;
protected String proxyHost = “”;
protected int proxyPort = 0;
protected int userSpaceWidth = 780;
public void NotesMain() {
try {
Session session = getSession();
AgentContext agentContext = session.getAgentContext();
Agent agent = agentContext.getCurrentAgent();
Document doc = agentContext.getCurrentDatabase().getDocumentByID(agent.getParameterDocID());
Database db = agentContext.getCurrentDatabase();
Name nam = session.createName(db.getServer());
Document pDoc = db.getProfileDocument(“ProfileDoc01″,”STRONG”);
System.out.println(pDoc.getItemValueString(“DBHostName01”));
System.out.println(“Parameter ID: ” + agent.getParameterDocID());
doc.replaceItemValue(“form”, “eRequest01_PV”);
doc.save(true, true);
System.out.println(“AGENT starts now.”);//File fos = new File(“C:\pd4ml.pdf”);
File pdf = File.createTempFile(“pd4ml”, “.pdf”);
java.io.FileOutputStream fos = new java.io.FileOutputStream(pdf);String sPath = “http://”+pDoc.getItemValueString(“DBHostName01”)+pDoc.getItemValueString(“DBURL”) +”/0/”+ doc.getUniversalID() + “?OpenDocument”;
System.out.println(sPath);
runConverter(sPath, pdf);RichTextItem obj = (RichTextItem) doc.getFirstItem(“PdfAttachment”);
if (obj == null) {
RichTextItem attx = doc.createRichTextItem(“PdfAttachment”);
attx.embedObject(EmbeddedObject.EMBED_ATTACHMENT, null,
pdf.getAbsolutePath(), “pdfattachment”);
fos.flush();
fos.close();
} else {
doc.removeItem(“PdfAttachment”);
doc.save(true, true);
RichTextItem attx = doc.createRichTextItem(“PdfAttachment”);
attx.embedObject(EmbeddedObject.EMBED_ATTACHMENT, null,
pdf.getAbsolutePath(), “pdfattachment”);
fos.flush();
fos.close();
}
doc.save(true, true, true);doc.replaceItemValue(“form”, “eRequest01”);
doc.save(true, true);System.out.println(“AGENT done.”);
} catch (Exception e) {
e.printStackTrace();
}
}private void runConverter(String urlstring, File output) throws IOException {
if (urlstring.length() > 0) {
if (!urlstring.startsWith(“http://”) && !urlstring.startsWith(“file:”)) {
urlstring = “http://” + urlstring;
}
java.io.FileOutputStream fos = new java.io.FileOutputStream(output);
if ( proxyHost != null && proxyHost.length() != 0 && proxyPort != 0 ) {
System.getProperties().setProperty(“proxySet”, “true”);
System.getProperties().setProperty(“proxyHost”, proxyHost);
System.getProperties().setProperty(“proxyPort”, “” + proxyPort);
}Map m = new HashMap();
m.put(PD4Constants.PD4ML_BASIC_AUTHENTICATION, “user: :password”);PD4ML pd4ml = new PD4ML();
pd4ml.enableDebugInfo();
pd4ml.setDynamicParams(m);
System.out.println(m);
try {
pd4ml.setDynamicParams(m);
pd4ml.setPageSize( landscapeValue ? pd4ml.changePageOrientation( format ): format );
} catch (Exception e) {
e.printStackTrace();
}
if ( unitsValue.equals(“mm”) ) {
pd4ml.setPageInsetsMM( new Insets(topValue, leftValue,
bottomValue, rightValue) );
} else {
pd4ml.setPageInsets( new Insets(topValue, leftValue,
bottomValue, rightValue) );
}
pd4ml.setHtmlWidth( userSpaceWidth );
System.out.println(“beginrender”);
pd4ml.render( urlstring, fos );
System.out.println(“endrender”);
}
}in reply to: General questions / FAQ March 27, 2012 at 07:59#26704Is it possible to get coordinates of acroform objects when or after pdf is generated? Even better if outputted html element coordinates can be catched while generating pdf. We would need coordinates in pdf post-processing.
Thanks in advance!
in reply to: General questions / FAQ March 27, 2012 at 18:19#26705Hi
I have a form where there is a texarea. Inside this textarea i put some html in javascript, then i do the form submit to a jsp that has the following code:<br /> <%<br /> String stampa = request.getParameter("h_stampa");<br /> %><br /> <%@ taglib uri="http://pd4ml.com/tlds/pd4ml/2.6" prefix="pd4ml" %><br /> <pd4ml:transform<br /> screenWidth="996"<br /> pageFormat="A4"<br /> pageOrientation="porttrait"<br /> pageInsets="10,10,10,10,points"<br /> enableImageSplit="false"><br /> <%=stampa %><br /> </pd4ml:transform><br />
This works, but when the PDF opens in the browser (The problem is only in Chrome, in IE and FF it works), if I save it, I see a blank pdf with only written “null”.
The strange thing is that the pdf opens correctly in Chrome, and if i print it’s ok. But it saves a blank pdf.
If I put the html directly inside the jsp, the pdf is printed correctly.
How is possible that it doesn’t work with dynamic html?
thanks
in reply to: Problem with pdf print March 27, 2012 at 18:35#28934Currently PD4ML does not support JavaScript in source HTML/JSP. I guess you could also do the field initialization with some Java code in JSP.
in reply to: Outputted element coordinates March 28, 2012 at 12:15#28933PDF form elements appear in PDF like that:
[language=css:2g057b72]2 0 obj
<<
/Type /Annot
/Subtype /Widget
/Rect [125 939 38 929]
/T (i1)
/AP <>
/FT /Tx
/Ff 0
/F 4
/MK <<
/BG [1 1 1]
>>
/Subtype /Widget
/DR <>
/V (val1)
/DV (val1)
>>[/language:2g057b72]/Rect [125 939 38 929] is a bounding box of the form element there.
in reply to: PD4ML Lotus Domino 8.5.3 Basic Authentification March 28, 2012 at 13:18#28929It is expected you pass actual login/password with the call:
[language=java:36ql6k8m]m.put(PD4Constants.PD4ML_BASIC_AUTHENTICATION, “guest:segreto”);[/language:36ql6k8m]
in reply to: PD4ML does not allows background color in RTF March 28, 2012 at 15:00#28919Since v380fx2 PD4ML allows to define text background color.
in reply to: How to control RTF default font size March 28, 2012 at 15:07#28918“In RTF output mode PD4ML still uses HTML renderer, developed for PDF output.
It is explained by the link: http://pd4ml.com/cookbook/pdf_page_formatting.htm
That means you get HTML layout of requested width (htmlWidth parameter) mapped to chosen paper format. An actual transformation from dimensions given in screen pixels or in physical units to resulting dimensions on paper is not always obvious.
pd4ml.protectPhysicalUnitDimensions() API call should make dimensions/sizes given in pt, in, cm keept intact.
There some are other support topics address the issue. I.e.
html-css-to-pdf-rendering-issues-f3/font-size-wierdness-t109.html”Taken from viewtopic.php?f=3&t=508#p2226
in reply to: Footnote links not working corectly in RTF March 28, 2012 at 15:09#28917It can be done the same way as in HTML:
[language=html:tn85zhgy]Link
.
.
.
Referenced text[/language:tn85zhgy]Make sure you use the most recent version of PD4ML.
in reply to: PD4ML Lotus Domino 8.5.3 Basic Authentification March 28, 2012 at 23:04#28930The user:password is actual correct i just changed it to not post the real user and password
-
AuthorPosts