Forum Replies Created

Viewing 15 posts - 1,936 through 1,950 (of 4,243 total)
  • Author
    Posts
  • 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: Deployment / Configuration issues
    #26741

    Hi,
    I have a problem exporting the jpg base64 image to PDF. I turn on the debug mode in the pd4ml tag and I am getting the following error message:
    version: PD4ML 380 Pro
    Bad Base64 input character at 76: 37(decimal)
    resource data:image/jpg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDA

    Please help.

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

    Ok, thankyou.
    Clearly we’re a bit worried about this so please keep us posted. Thanks.

    in reply to: General questions / FAQ
    #26742

    hello,
    can you please provide me the servlet code in which i can convert html string url to pdf.

    it will save my lot of time.

    Prashant

    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: need servlet code for converting html string to pdf
    #29032

    [language=java:2bbaexst]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(“http://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 );
    }
    }[/language:2bbaexst]

    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:
    [language=xml:1c85moiu]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.[/language:1c85moiu]

    The servlet code I used for tests:
    [language=java:1c85moiu]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(“http://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 );
    }
    }[/language:1c85moiu]

    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
    #29033

    Hello,
    I tried to run above code in my applicayion which is a JSF enabled application.while trying to convert given URL i get the following exception.

    java.lang.NullPointerException
    org.zefer.pd4ml.PD4ML.o00000(Unknown Source)
    org.zefer.pd4ml.PD4ML.render(Unknown Source)
    com.xyz.report.jsf.HtmlToPDF.doGet(HtmlToPDF.java:38)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
    org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
    com.xyz.servlet.BaseEntityFilter.doFilter(BaseEntityFilter.java:44)

    my code is

    public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {

    URL url = new URL(“http://localhost:8080/xyzweb/faces/templates/includes/report/A104_fv_1.xhtml”);

    PD4ML pd4ml = new PD4ML();

    pd4ml.setPageSize( PD4Constants.A4 );
    pd4ml.setPageInsets( new java.awt.Insets(20, 50, 10, 10) );
    pd4ml.setHtmlWidth(1000);
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    pd4ml.render(url, baos);
    //pd4ml.render(arg0, arg1)
    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: 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: need servlet code for converting html string to pdf
    #29035

    Hello,
    i am using pd4ml 3.8.0fx4 version

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

    i think the problem is url is not able to read because of session. the xhtml in url shown is generated through the code and then user can view the report through that url.
    do you have any suggestions how to handle this case with the session?

    Prashant.

    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:

    [language=java:3d15w8pg]URL url = new URL(“http://localhost:8080/xyzweb/faces/templates/includes/report/A104_fv_1.xhtml” +
    “;jsessionid=” + request.getSession().getId());[/language:3d15w8pg]

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

    in reply to: General questions / FAQ
    #26744

    I recently set
    enableImgSplit(false) in my code, as I had some new documents where the image was breaking in the middle of the page break.
    Once I added this, on SOME documents, the header is getting broken. On some it still works fine. It seems so far to break on the documents that have images spanning pages.
    The *image* in the header (logo in top left) still appears, but the rest of the header disappears.
    If I comment out enableImgSplit(false), headers appear again.

    Has anyone see anything like this? I am using 380fx4.

    Here is sample of my header

    Title
    Product Brand
    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: enableImgSplit(false) breaks header?
    #29041

    @PD4ML wrote:

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

    I am using using 380fx4. I believe I have the “volume license”.

Viewing 15 posts - 1,936 through 1,950 (of 4,243 total)