Forum Replies Created

Viewing 15 posts - 646 through 660 (of 1,410 total)
  • Author
    Posts
  • in reply to: enableImgSplit(false) breaks header?
    #29040

    Which version of PD4ML do you currently use? The problem should not affect the actual ones.

    in reply to: need servlet code for converting html string to pdf
    #29037

    You need to pass the session id with request.

    The simplest way would be to embed the session ID to the URL:

    URL url = new URL("http://localhost:8080/xyzweb/faces/templates/includes/report/A104_fv_1.xhtml" +
    ";jsessionid=" + request.getSession().getId());

    A bit trickier approach is to pass session IDs via cookies.

    in reply to: need servlet code for converting html string to pdf
    #29034

    Which PD4ML version do you currently use? You could check it in Manifest file of pd4ml.jar

    in reply to: Anybody had problems with PD4ML on Lion for Mac?
    #28966

    In the meantime we tried a variety of environments. Here is my current state:

    igors-imac:bin igor$ sudo ./daemon.sh version
    Password:
    Still running according to PID file /Library/Tomcat//logs/catalina-daemon.pid, PID is 5901
    jsvc (Apache Commons Daemon) 1.0.10
    Copyright (c) 1999-2011 Apache Software Foundation.
    java version "1.6.0_33"
    Java(TM) SE Runtime Environment (build 1.6.0_33-b03-424-11M3720)
    Java HotSpot(TM) 64-Bit Server VM (build 20.8-b03-424, mixed mode)
    commons daemon version "1.0.10"
    commons daemon process (id: 5914, parent: 5913)
    Server version: Apache Tomcat/7.0.27
    Server built:   Mar 31 2012 03:43:36
    Server number:  7.0.27.0
    OS Name:        Mac OS X
    OS Version:     10.7.4
    Architecture:   x86_64
    JVM Version:    1.6.0_33-b03-424-11M3720
    JVM Vendor:     Apple Inc.

    The servlet code I used for tests:

    import java.io.ByteArrayOutputStream;
    import java.io.IOException;
    import java.net.URL;
    
    import javax.servlet.ServletOutputStream;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    
    import org.zefer.pd4ml.PD4Constants;
    import org.zefer.pd4ml.PD4ML;
    
    
    public class PD4MLServlet extends HttpServlet {
    
    public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
    
    URL url = new URL("https://pd4ml.com/xindex.htm");
    
    PD4ML html = new PD4ML();
    html.setPageSize( PD4Constants.A4 );
    html.setPageInsets( new java.awt.Insets(20, 50, 10, 10) );
    html.setHtmlWidth( 850 );
    
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    html.render( url, baos );
    
    byte[] result = baos.toByteArray();
    
    response.setContentType("application/pdf");
    response.setHeader("Content-disposition","inline; filename=test.pdf");
    response.setHeader("Pragma", "cache");
    response.setHeader("Expires", "0");
    response.setHeader("Cache-control", "private");
    
    response.setContentLength(result.length);
    ServletOutputStream sos = response.getOutputStream();
    sos.write( result );
    }
    }

    Everything works just fine. So it should be an issue of an interfere of PD4ML with some other libs on your side. Please try the servlet – it the conversion fails, try to exclude libs one-by-one from your project until it started to work. It would be great if you share the results with us.

    in reply to: need servlet code for converting html string to pdf
    #29032

    import java.io.ByteArrayOutputStream;
    import java.io.IOException;
    import java.net.URL;
    
    import javax.servlet.ServletOutputStream;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    
    import org.zefer.pd4ml.PD4Constants;
    import org.zefer.pd4ml.PD4ML;
    
    
    public class PD4MLServlet extends HttpServlet {
    
    public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
    
    URL url = new URL("https://pd4ml.com");
    
    PD4ML html = new PD4ML();
    html.setPageSize( PD4Constants.A4 );
    html.setPageInsets( new java.awt.Insets(20, 50, 10, 10) );
    html.setHtmlWidth( 850 );
    
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    html.render( url, baos );
    
    byte[] result = baos.toByteArray();
    
    response.setContentType("application/pdf");
    response.setHeader("Content-disposition","inline; filename=test.pdf");
    response.setHeader("Pragma", "cache");
    response.setHeader("Expires", "0");
    response.setHeader("Cache-control", "private");
    
    response.setContentLength(result.length);
    ServletOutputStream sos = response.getOutputStream();
    sos.write( result );
    }
    }

    in reply to: Rendering JPG base64 JSP image problem
    #29031

    Most probably the problem is caused by an erroneous appending of a session ID to the base64 image source.

    The issue has been already solved in the actual development build. the update will be available with the forthcoming beta release next week.

    in reply to: HTML is being printed backwards
    #29020

    From the HTML sample you sent I got correct result. See attached.

    (I only changed content=”charset=UTF-8″ to content=”text/html; charset=UTF-8″)

    If it does not work for you, try to add dir=”rtl” or dir=”ltr” attribute to tag. It is something wrong on you side with initial conditions for Arabic ligaturizing – probably there are CSS styles impact it.

    in reply to: Erratic NullPointerException in PD4ML.render()
    #29026

    Did you check if the problem exists in the most recent version of PD4ML?

    in reply to: html header and footer in every pdf page not displays
    #29027

    There are and tags intended for that.

    See https://pd4ml.com/cookbook/pdf_header_footer_generation.htm

    in reply to: Xhtml to pdf conversion
    #29028

    Probably the most straightforward approach: create a simple converter JSP and point it to XHTML page via <jsp:include>

    <%@ taglib prefix="pd4ml" uri="https://pd4ml.com/tlds/pd4ml/2.6" %><pd4ml:transform
    screenWidth="1000">
    <jsp:include page="xhtml.jsp">
    </pd4ml:transform>

    in reply to: pd4ml:transform and "Didn’t meet stated Content-Length"
    #29024

    > Does PD4ML set the content length?

    Of course, yes. PDF is binary data, so it always makes sense to set it.

    The problem, you faced with, most probably caused by an undesired text encoding conversion, applied to PDF bytes. For example Latin-1 to UTF-8 – that explains why the actual data amount has grown. Obviously UTF-8 became a default file encoding after you upgraded to Oracle 11g.

    What to do?
    1. Try to run Oracle with file.encoding set to the same value as it was in previous installation
    2. If #1 is not possible, try to add encoding=”UTF-8″ or encoding=”default” attribute to <pd4ml:transform>

    Also there are 3 new line characters before <pd4ml:transform> – they will be sent before PD4ML started to send PDF bytes. It is a good idea to remove them.

    in reply to: PNG Rendering
    #29023

    Please send a generated PDF and its sources to support pd4ml com

    in reply to: pd4ml for jsp deployment in tomcat 6.0 is not working
    #29021

    Does the exception disappear if you remove pd4ml_demo.jar and ss_css2.jar from WEB-INF/lib ?

    in reply to: absolute uri: https://pd4ml.com/tlds/pd4ml/2.6
    #29016

    1. Obviously PD4ML JSP taglib (pd4ml_tl.jar – part of PD4ML distribution) is missing in WEB-INF/lib.

    2. The conversion happens in your environment – no data sent to pd4ml.com

    in reply to: Anybody had problems with PD4ML on Lion for Mac?
    #28964

    Next week we plan to analyze the problem in depth and find a solution

Viewing 15 posts - 646 through 660 (of 1,410 total)