Forum Replies Created
-
AuthorPosts
-
in reply to: changePageOrientation in RTF January 15, 2014 at 14:00#29455
@PD4ML wrote:
Portrait:
pd4ml.setPageSize( PD4Constants.A4 );
Landscape:
pd4ml.setPageSize( pd4ml.changePageOrientation( PD4Constants.A4 ) );Yes, i use always second type, but it have no effect:
private static int PDF = 1;<br /> private static int RTF = 2;<br /> <br /> @Test<br /> public void pd4TestRun() throws Exception {<br /> convert(<path>, "C:\result.rtf", RTF);<br /> convert(<path>, "C:\result.pdf", PDF);<br /> }<br /> <br /> private void convert(String input, String output, int type) throws Exception {<br /> FileOutputStream fos = new FileOutputStream(new File(output));<br /> <br /> PD4ML pd4ml = new PD4ML();<br /> if (type == RTF) pd4ml.outputFormat(PD4Constants.RTF);<br /> pd4ml.setPageSize(pd4ml.changePageOrientation(PD4Constants.A4));<br /> pd4ml.setPageInsets(new Insets(20, 20, 20, 20));<br /> pd4ml.setHtmlWidth(1024);<br /> pd4ml.disableHyperlinks();<br /> pd4ml.useTTF("java:fonts", true);<br /> pd4ml.setDefaultTTFs("Times New Roman", "Arial", "Courier New");<br /> InputStream is = new FileInputStream(new File(input));<br /> InputStreamReader inputStreamReader = new InputStreamReader(is);<br /> pd4ml.render(inputStreamReader, fos, new File(input).toURL());<br /> fos.close();<br /> }
This code generate 2 files (attached to this message). But PDF is landscape, and RTF is portrait.
I need landscape both.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: General questions / FAQ January 17, 2014 at 13:48#26899That depends on where you define
<style>section in your document. Also it depends on media attribute value.Can you publish a minimalistic example, which illustrates the issue?
in reply to: Deployment / Configuration issues January 24, 2014 at 10:44#26902Hi ,
I am facing the issue . It works well on windows but Gives Error on Linux Machine. Can any one tell me is there really difference between linux and windows behavior .
For me its works fine in windows with error “getOutputStream() has already been called” . In windows it gives the Error but opens the document in PDF.
while in Linux its gives error getOutputStream() has already been called” and message “there was an error opening this document.the file is damanged and could not be repaired” . So on linux it doesnt generate the PDf.
Regards
Jordanin reply to: Html to Pdf Conversion is not happening in linux January 24, 2014 at 10:53#28982Hi ,
I am facing the same issue , can you please tell me hwo did you resolve the issue?
As its working fine for me in windows bt on linux gives the error.
Regards
Jordanin 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: PRob generating PDF on Linux works fine on windows January 24, 2014 at 18:06#29475Hi ,
Thank you for your reply , but there isnt any space in
“%@page contentType=”text/html; charset=ISO8859_1”
%>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 19:44#29477Hi ,
Thank you for your quick Response , i will send the Jsp 2morrow but by the time can you tell me the possible points to trouble shoot.
I am getting Errror on jsp is “getoutputstream has already been called for this response java lang illegalstateexception”. but with this exception its works fine on Win but give the error on linux.
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 27, 2014 at 03:48#29479Hi ,
As par the discussion please find the Top part of Jsp attached. Also the Tag
is closed at very bottom like
“</html:form> </body> </html> </pd4ml:transform>
” …Plese provide me your suggestions.
Regards
Jordanin 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: Troubleshooting February 11, 2014 at 10:42#26904can PD4ML support the ligatures words in indian languge..
in reply to: Troubleshooting February 27, 2014 at 14:00#26908Hello,
in our application we generate PDF-Files with forms. The generated files were read with the pdf lib Apache pdfbox. Since we updated pd4ml (Version 3.8.1fx2 to 3.8.5fx6) pdfbox can’t read the generated files with form-elements (text- and checkboxes). The error message is: “Error: Expected a long type, actual=’>>'”
If i open the resulting PDF with an text editor i count one more “>>”-token than “<<". Am i right that these tokens wrap pdf objects and i should find the same number of both tokens? Is this behaviour a bug? Example HTML:<br /> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><br /> <html><br /> <head><br /> <title>Test</title><br /> </head><br /> <body><br /> <input type="text" value="test"/><br /> </body><br /> </html><br />transform html to pdf on command line:<br /> java -Xmx512m -cp .pd4ml-3.8.5fx6.jar Pd4Cmd file:Test.html 1200 -pdfforms -out Example.pdf<br />pdfbox reading example (java):<br /> public static void main(String[] args)<br /> throws IOException {<br /> PDDocument.load(new File("Example.pdf"));<br /> }I am looking forward to get an helpful answer 🙂 Thank youin 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.
-
AuthorPosts
