Forum Replies Created
-
AuthorPosts
-
in reply to: where do i find updated ss_css2.jar file March 25, 2014 at 12:33#29482
The most recent PD4ML versions include the most actual ss_css2.jar we have. if you experience troubles with CSS parsing it would make sense to analyze the problem reason and to adjust CSS stylesheet correspondingly. Unfortunately ss_css2.jar “understands” not all CSS3 syntax constructs may appear in stylesheets.
in reply to: how to add css files in jsp which is transformed to pdf ?? March 17, 2014 at 13:52#29500You should not enclose CSS links to
<style>tag.Wrong:
<style type="text/css" rel="stylesheet"> <link rel="stylesheet" href="Style/external/bootstrap.css" /> <link rel="stylesheet" href="Style/external/styles-plugins.css" /> <link rel="stylesheet" href="Style/external/styles-main.css" /> </style>
Correct (must be placed to
<head>):
<link rel="stylesheet" href="Style/external/bootstrap.css" /> <link rel="stylesheet" href="Style/external/styles-plugins.css" /> <link rel="stylesheet" href="Style/external/styles-main.css" />
in reply to: how to add css files in jsp which is transformed to pdf ?? March 17, 2014 at 12:31#29502Obviously you have HTML-like comments in the CSS file. It is invalid from CSS file format perspective. Correct comment syntax is /* */
Try to remove constructs like
<!-- -->.in reply to: how to add css files in jsp which is transformed to pdf ?? March 17, 2014 at 12:10#29497If you use
<pd4ml:transform>custom tag, you may enable debug info with debug=”true” attribute.There is no need to call pd4ml.addStyle() in JSP, as you may add inline
<style>tag or a link to a CSS stylesheet as you would do that in a regular HTML or JSP.in reply to: Could not find the main class: Pd4Cmd. Program will exit. March 13, 2014 at 10:46#29495I do not believe there is a problem with java_home, as the java runtime successfully starts. First I would suspect /root/pd4ml.prof.380fx9/lib/pd4ml.jar is invalid or JVM process has no permissions to read it.
in reply to: Can not read a pd4ml-PDF with checkbox with pdfbox February 28, 2014 at 12:25#29493Yes, it was a bug in our code. Please contact support pd4ml com for an updated version.
in reply to: PRob generating PDF on Linux works fine on windows January 27, 2014 at 19:34#29480Your code:
<%@ taglib uri="/WEB-INF/struts-bean" prefix="bean"%> <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> <%@ taglib uri="/WEB-INF/c-rt" prefix="c-rt"%> <%@ page errorPage="/general/ErrorPage.jsp"%> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> <%@ page isELIgnored="false"%> <%@ page contentType="text/html;charset=UTF-8"%> <%@page import="java.util.ArrayList,java.util.Iterator,com.website.utils.DateUtil"%> <%@ taglib uri="https://pd4ml.com/tlds/pd4ml/2.5" prefix="pd4ml" %><pd4ml:transform screenWidth="1500" pageFormat="A4" pageOrientation="landscape" pageInsets="5,5,5,5,mm" enableImageSplit="false" fileName="Transporter Registration for transhipment" inline="false" debug="true" >
Should be (all new line characters ‘n’ before
<pd4ml:transform>removed):<%@ taglib uri="/WEB-INF/struts-bean" prefix="bean"%><%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%><%@ taglib uri="/WEB-INF/c-rt" prefix="c-rt"%><%@ page errorPage="/general/ErrorPage.jsp"%><%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%><%@ page isELIgnored="false"%><%@ page contentType="text/html;charset=UTF-8"%><%@ page import="java.util.ArrayList,java.util.Iterator,com.website.utils.DateUtil"%><%@ taglib uri="https://pd4ml.com/tlds/pd4ml/2.5" prefix="pd4ml" %><pd4ml:transform screenWidth="1500" pageFormat="A4" pageOrientation="landscape" pageInsets="5,5,5,5,mm" enableImageSplit="false" fileName="Transporter Registration for transhipment" inline="false" debug="true" >
in reply to: PRob generating PDF on Linux works fine on windows January 24, 2014 at 19:51#29478There should be a whitespace before
<pd4ml:transform>tag. It can be not obvious in JSP code, but the exception tells, that probably a new line char has been already sent to HTTP stream (JSP container implicitly opens HTTP stream for that).<pd4ml:transform>tries to open the stream again, and causes the exception.As I wrote, for different JSP containers the situation has a different severity. On Win it is just a warning, on Linux it could be fatal.
Could you please just copy paste a top part of your JSP and publish here?
in reply to: PRob generating PDF on Linux works fine on windows January 24, 2014 at 18:24in reply to: PRob generating PDF on Linux works fine on windows January 24, 2014 at 11:02#29474A problem reason and a workaround is explained in the post:
pdf-generation-troubleshooting-f4/getoutputstream-has-already-been-called-exception-t14.html“getOutputStream() has already been called” error has different “fatality” on different JSP platforms, probably that explains why it works on Win and does not on Linux. But the best solution would be to update the JSP to suppress the error.
in reply to: changePageOrientation in RTF January 15, 2014 at 17:11#29456You are right: we’ve just found a bug in our code. A solution will be available with the new maintenance release in 1-2 weeks. Or request a dev build by email from support pd4ml com
in reply to: changePageOrientation in RTF January 15, 2014 at 12:25#29454I guess I misunderstood you first time. PD4ML does not support a dynamic format change: for example, the first page is portrait, the second is landscape.
To avoid possible code errors, try to define format explicitly, without conditions:
Portrait:
pd4ml.setPageSize( PD4Constants.A4 );Landscape:
pd4ml.setPageSize( pd4ml.changePageOrientation( PD4Constants.A4 ) );in reply to: changePageOrientation in RTF January 14, 2014 at 14:31#29452For the time being, PD4ML does not support the feature by RTF output.
Also I am not sure if RTF file format implements such a feature. Do you have an RTF sample (probably created with MS Word or OpenOffice) to confirm it is possible?
in reply to: pdf generation performance issue December 12, 2013 at 13:12#29451I checked the document sources.
Well, as I suspected the document layout is built as a single table. The table cells also include multi-nested tables (up to 4 nesting levels).
It should help a lot if by the HTML document generation (hopefully you have a control over the process) you can omit the “main table” – just output its nested content.
in reply to: pdf generation performance issue December 10, 2013 at 10:14#29449A conversion duration primarily depends on HTML/CSS file size and its structure. So an HTML sample would help to analyze the issue in details.
Typical reasons of such performance issues:
– Huge CSS stylesheet: as we seen a couple of times, some “web optimised” HTML documents may include 2-3 Mb CSS style, tuned to suppress known banner exchange engines. The style makes no sense for HTML document layout, but makes CSS parser/runtime to spend quite a lot of resources to maintain the styles and it significantly slows down style resolving for a particular HTML element. Unfortunately CSS parser we use is not optimised to deal with extra big stylesheets.
– The entire document layout is built as a single table with tens or hundred thousands of cells. If the table is nested to another table – rendering takes 3 times longer; 2 levels of nesting – 9 times longer etc. For big documents we recommend to split a huge table to a sequence of smaller ones and avoid a table nesting.
If you are interested, a technical background of that is following: each cell width is calculated 3 times for MIN, MAX and optimal values. So every nesting level multiplies the “layouting” approaches to 3. If, lets say a content of a cell of a particular table row does not fit a column width calculated before, it needs to start table layouting again, taking into account a new condition.
-
AuthorPosts
