Forum Replies Created

Viewing 15 posts - 1,171 through 1,185 (of 4,243 total)
  • Author
    Posts
  • in reply to: Nested CSS definitions not rendered
    #27474

    @PD4ML wrote:

    Could you please also publish an HTML snippet, you want to apply the CSS to.

    Also, to make sure the CSS selector does not work, try to temporarily add any obvious CSS property, like “color: red”.

    The HTML page, I want to apply the CSS to is generated by using JSF and Primefaces.
    Here is an extract:
    [language=html:3qakaise]

    ANNU – LdapAdmin – V1.3 – 20 févr. 2011 – 4 bug(s)
    Identifiant Résumé Statut Ciblée Fixée Création MAJ
    18950 Réinitialisation du mot de passe TW de certains comptes génériques hors-service résolu V1.3 V1.3 31 janv. 2011 2 mars 2011
    19390



    [/language:3qakaise]

    Moreover, I’m quite sure that the CSS is not applied because the cell border doesn’t appear.

    in reply to: Error while rendering PDF
    #28482

    It seems the exception is thrown by an image colorspace processing. Can you please temporarily comment images out from the document? Does it help?

    If yes, it would be nice if you send us the images that cause the problem.

    in reply to: Nested CSS definitions not rendered
    #27475

    In the HTML I see no any element of class ui-datatable-data-empty, so the selector always returns nothing.

    If your concern is about borders of empty cells, it can be solved with

    TABLE { empty-cells: show }

    in reply to: Nested CSS definitions not rendered
    #27476

    @PD4ML wrote:

    In the HTML I see no any element of class ui-datatable-data-empty, so the selector always returns nothing.

    If your concern is about borders of empty cells, it can be solved with

    TABLE { empty-cells: show }

    I made a mistake. The CSS part is the following:
    [language=css:2u9e9msa].ui-datatable .ui-datatable-data td, .ui-datatable .ui-datatable-data-empty td{
    border-color:inherit;
    border-style:solid;
    border-width:1px;
    padding: 4px 10px;
    }[/language:2u9e9msa]
    With this one, it should work.

    in reply to: Nested CSS definitions not rendered
    #27477

    PD4ML does not support

    tag. It simply ignores it.

    So TBODY.ui-datatable-data condition makes the selector to fail.
    As a workaround I would recommend to remove .ui-datatable-data from there.

    [language=css:2o5v2soz].ui-datatable td, .ui-datatable .ui-datatable-data-empty td{
    border-color:inherit;
    border-style:solid;
    border-width:1px;
    padding: 4px 10px;
    }[/language:2o5v2soz]

    in reply to: Nested CSS definitions not rendered
    #27478

    @PD4ML wrote:

    PD4ML does not support

    tag. It simply ignores it.

    So TBODY.ui-datatable-data condition makes the selector to fail.
    As a workaround I would recommend to remove .ui-datatable-data from there.

    [language=css:17o7cf6v].ui-datatable td, .ui-datatable .ui-datatable-data-empty td{
    border-color:inherit;
    border-style:solid;
    border-width:1px;
    padding: 4px 10px;
    }[/language:17o7cf6v]

    Here is the issue. Ok, I’m now able to correct it. Thanks a lot for your help.
    Moreover, we use the 3.5.1 professional version. If we want update to the 3.7.0 one, do we have to pay it?

    in reply to: Nested CSS definitions not rendered
    #27479

    It depends on the issue date of your license. Please contact sales pd4ml com

    in reply to: General questions / FAQ
    #26437

    I tried the option -pdfa on a command line:
    export CLASSPATH=/home/castiler/Pd4ml/pd4ml_demo.jar:/home/castiler/Pd4ml/ss_css2.jar
    java -Xmx512m -Djava.awt.headless=true -cp pd4ml_demo.jar Pd4Cmd ‘file:NOUVEL-AVIS-ADRESSE.html’ 1200 -pdfa -out NOUVEL-AVIS-ADRESSEv370.pdf

    But i have this error when pass the pdf in “pdf validator”, ihave this error:
    1. Count : 1 ErrorCode : 2151745028 Message : The key Metadata is required but missing. ObjectNo : 19 PageNo : 0
    2. Count : 1 ErrorCode : 2151745028 Message : The key MarkInfo is required but missing. ObjectNo : 19 PageNo : 0
    3. Count : 1 ErrorCode : 54625812 Message : A device-specific color space (DeviceRGB) without an appropriate output intent is used. ObjectNo : 13 PageNo : 1
    4. Count : 1 ErrorCode : 4294404 Message : The font Courier must be embedded. ObjectNo : -1 PageNo : 6
    5. Count : 1 ErrorCode : 4294404 Message : The font Helvetica-Bold must be embedded. ObjectNo : -1 PageNo : 6
    6. Count : 1 ErrorCode : 4294404 Message : The font Helvetica must be embedded. ObjectNo : -1 PageNo : 6
    7. Count : 1 ErrorCode : 4294404 Message : The font Helvetica-Oblique must be embedded. ObjectNo : -1 PageNo : 6
    8. Count : 1 ErrorCode : 4294404 Message : The font Helvetica-BoldOblique must be embedded. ObjectNo : -1 PageNo : 6
    9. Count : 1 ErrorCode : 2202076690 Message : The document does not conform to the requested standard. ObjectNo : -1 PageNo : 6

    What can i do to have a valid pda/a ?

    in reply to: Not generating a pdf/a with option
    #28173

    There is no PDF/A-capable evaluation version of PD4ML available for download.
    Please contact support pd4ml com to get one.

    in reply to: Error while rendering PDF
    #28483

    hello

    yes the cause is an image with extention PNG .. but why its not accepting PNG images

    thanks

    in reply to: Error while rendering PDF
    #28484

    I did not wrote it accepts no PNG. Normally it has no problems with PNGs. But it could be that:
    1. your particular image has corrupted colorspace information
    2. there are bugs in the recent application update (the development build you evaluate did not pass QA yet).

    in reply to: Error while rendering PDF
    #28485

    Hi anas_srairah,
    can you give me an example of how I would use use PDF class in a servlet?

    in reply to: HTML/CSS rendering issues
    #26535

    hello

    i have a problem parsing png images … please let me know how to solve it

    thanks

    in reply to: Error while rendering PDF
    #28486

    hello

    here is an example servlet that uses the class directly beneath it to do the conversion job

    /*
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    */
    package ae.rwd.servlet;

    import ae.rwd.model.Pdf;
    import java.io.ByteArrayOutputStream;
    import java.io.IOException;
    import javax.servlet.ServletException;
    import javax.servlet.ServletOutputStream;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;

    /**
    *
    * @author Anas
    */
    public class PdfCreater extends HttpServlet {

    private static final String bodyUrlParamater = “bodyUrl”;
    private static final String headerUrlParamater = “headerUrl”;
    private static final String footerUrlParamater = “footerUrl”;
    private static final String charsetParamater = “charset”;
    private static final String contentType = “application/pdf”;

    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {

    ServletOutputStream out = response.getOutputStream();
    String bodyUrl = null;
    String headerUrl = null;
    String footerUrl = null;
    String charset = null;
    bodyUrl = request.getParameter(PdfCreater.bodyUrlParamater);
    if (bodyUrl == null || bodyUrl.length() == 0) {
    throw new ServletException();
    }

    headerUrl = request.getParameter(PdfCreater.headerUrlParamater);
    footerUrl = request.getParameter(PdfCreater.footerUrlParamater);
    charset = request.getParameter(PdfCreater.charsetParamater);

    ByteArrayOutputStream baos = Pdf.convertHtmlToPdf(bodyUrl, headerUrl, footerUrl, charset);

    response.setContentType(PdfCreater.contentType);
    response.setContentLength(baos.size());
    out = response.getOutputStream();
    baos.writeTo(out);
    out.flush();

    out.close();
    }

    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
    processRequest(request, response);
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
    processRequest(request, response);
    }

    @Override
    public String getServletInfo() {
    return “Short description”;
    }
    }

    /*
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    */
    package ae.rwd.model;

    import java.awt.Dimension;
    import java.io.BufferedReader;
    import java.io.ByteArrayOutputStream;
    import java.io.FileNotFoundException;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.InputStreamReader;
    import java.io.Reader;
    import java.io.StringWriter;
    import java.io.UnsupportedEncodingException;
    import java.io.Writer;
    import java.net.MalformedURLException;
    import java.net.URL;
    import org.zefer.pd4ml.PD4Constants;
    import org.zefer.pd4ml.PD4ML;
    import org.zefer.pd4ml.PD4PageMark;

    /**
    *
    * @author Anas
    */
    public class Pdf {

    protected static int userSpaceWidth = 638;
    protected static Dimension format = PD4Constants.A4;
    protected static boolean landscapeValue = false;
    protected static int topValue = 10;
    protected static int leftValue = 50;
    protected static int rightValue = 50;
    protected static int bottomValue = 10;

    public static ByteArrayOutputStream convertHtmlToPdf(String bodyUrl, String headerUrl, String footerUrl, String charsetParam) throws MalformedURLException, FileNotFoundException, IOException {

    java.io.ByteArrayOutputStream fos = null;
    PD4ML pd4ml = null;
    PD4PageMark header = null;
    PD4PageMark footer = null;
    String charset = “windows-1256”;
    URL url = new URL(bodyUrl);
    fos = new java.io.ByteArrayOutputStream();
    pd4ml = new PD4ML();

    if (charsetParam != null && charsetParam.trim().length() > 0 && charsetParam.equalsIgnoreCase(“UTF-8”)) {
    charset = “UTF-8”;
    }

    if (headerUrl != null) {
    header = new PD4PageMark();
    header.setHtmlTemplate(getUrlAsStream(headerUrl, charset));
    header.setAreaHeight(-1);
    pd4ml.setPageHeader(header);
    }

    if (footerUrl != null) {
    footer = new PD4PageMark();
    footer.setHtmlTemplate(getUrlAsStream(footerUrl, charset));
    footer.setAreaHeight(-1);
    pd4ml.setPageFooter(footer);
    }

    pd4ml.useTTF(“java:fonts”, true);
    //pd4ml.useTTF(“/windows/fonts”, true);
    //pd4ml.setDefaultTTFs(“Times New Roman”, “Arial”, “Courier New”);
    //pd4ml.setDefaultTTFs(“Simplified Arabic”, “ae_Arab”, “ae_Nice”);
    pd4ml.setPermissions(“empty”, PD4ML.AllowCopy, false);
    pd4ml.setPermissions(“empty”, PD4ML.AllowModify, false);
    pd4ml.setPermissions(“empty”, PD4ML.AllowPrint, true);
    // pd4ml.setPageInsets(new Insets(topValue, leftValue, bottomValue, rightValue));
    pd4ml.setHtmlWidth(userSpaceWidth);
    pd4ml.setPageSize(format);
    pd4ml.enableDebugInfo();
    pd4ml.adjustHtmlWidth();

    pd4ml.render(url, fos);

    return fos;
    }

    private static String getUrlAsStream(String Url, String charset) throws MalformedURLException, IOException {
    URL url = new URL(Url);
    return convertInputStreamToString(url.openConnection().getInputStream(), charset);
    }

    private static String convertInputStreamToString(InputStream is, String charset) throws IOException, UnsupportedEncodingException {
    if (is != null) {
    Writer writer = new StringWriter();
    char[] buffer = new char[1024];
    try {
    Reader reader = new BufferedReader(new InputStreamReader(is, charset));
    int n;
    while ((n = reader.read(buffer)) != -1) {
    writer.write(buffer, 0, n);
    }
    } finally {
    is.close();
    }
    return writer.toString();
    } else {
    return “”;
    }
    }
    }

    i hope this good for you

    thanks

    in reply to: General questions / FAQ
    #26537

    Dear pd4ml’s staff,

    I can see there are many successful case to use pd4ml. I am looking for Java library that converting html to pdf. But what we plan to do is to have the PDF in the server as an intermediate product (in form of byte stream or solid file) and then send the data to a network printer for print out.

    I wonder someone can point me out how can I achieve it (by providing a URL, then save it as byte [] or byte stream)?

    For the header and footer content, I suppose it should mean they are appear on every page. But do they have height limitation?

    Kindly look forward to see your rapid response.

Viewing 15 posts - 1,171 through 1,185 (of 4,243 total)