Forum Replies Created

Viewing 15 posts - 961 through 975 (of 1,410 total)
  • Author
    Posts
  • in reply to: Java 6.0_24b07 crashes while in finalize of PD4Device
    #28434

    PD4ML is 100% Java application, so “in theory” it cannot crash JVM. As a rule such fatal crashes are caused by inconsistencies in JDK installation or by JVM bugs (specific for a particular platform).

    I googled for similar stack traces – the only thing I suspect is that java.awt.color.ICC_Profile.getData() is not thread safe. Did you face with the problem when the application was under a heavy load (multiple simultaneous requests)?

    The problematic method is called for PNG images and only for PNGs have ICC color profile. Probably there is a “killer” PNG image, your JVM instance is not able to deal with. Could you please try to identify it?

    Depending on your feedback we’ll produce a test version of PD4ML with synchronized ICC_Profile.getData() calls and with a possibility to disable the calls at all (it is a good practice to have image color profiles embedded to PDF, but it is not mandatory).

    in reply to: initialPageNumber
    #28394

    A version with the feature (v370fx2) is already available for download.

    In command line an initial page number can be defined like that:
    … -param pd4ml.initial.page.number 3

    Unfortunately in RTF format we found no way to impact total number of pages value correspondingly, as it is by PDF output.

    in reply to: default zoom
    #28432

    As far as I know there is no way to pre-define in PDF initial zoom factor. You may define it as AcroRead command line/URL parameter.

    See http://partners.adobe.com/public/developer/en/acrobat/PDFOpenParameters.pdf

    In PDF file itself you may define starting document view mode. For example the code

    Map m = new HashMap();
    m.put(PD4Constants.PD4ML_DOCUMENT_VIEW_MODE, "SinglePage");
    pd4ml.setDynamicParams(m);

    (or
    Pd4Cmd ... -param pd4ml.document.view.mode SinglePage )

    forces AcroRead to open the doc scaled down to fit viewer window.

    in reply to: initialPageNumber
    #28393

    The feature is still under development – there are some technical complexities with the implementation. In a couple of days we’ll inform you if it is going to be included to the forthcoming release.

    in reply to: placing a footnote text o a page
    #28431

    An HTML sample and its resulting PDF would help a lot to analyze the issue. Please publish them here or send to support pd4ml com

    in reply to: How to generate pdf for constrained urls
    #27601

    As a rule a session ID is propagated via cookies or as an URL parameter. Just check how it is in your case and invoke pd4ml.setCookie() before render() call or add the session ID to the URL string:

    http://myserver.com/(tsdfg2usdfgvrj3vxgvg)/start.aspx

    (the actual sessionID-enabled URL syntax may vary)

    in reply to: Looking For PD4ML.NET Serve side Header/Footer Display Code
    #28416

    There is a new PD4ML.NET version available for download. Please check if it solves the issue.

    in reply to: Problem. 1 page correctly and 2 empty white pages.
    #28429

    It is difficult to say without an HTML sample.

    A typical reason – trailing white spaces at the end of the document. Try to add

    BODY { border: 1 solid red }

    CSS style to visualize the actual document content edges. Also make sure there is no explicit page break directives.

    in reply to: HTML5 Canvas – Anyone working on such a thing for PD4ML?
    #28381

    Steve, we implemented the first version of the feature. It is not available for download yet, so please contact support pd4ml com

    Now PD4ML checks if there is PD4CanvasHandler class available in the classpath and invokes its getImage() method for each <canvas> tag occurrence.

    Below is a dummy implementation of the handler class.

    import java.awt.Color;
    import java.awt.Graphics;
    import java.awt.image.BufferedImage;
    import java.io.ByteArrayOutputStream;
    import java.util.HashMap;
    import java.util.Iterator;
    import java.util.Vector;
    
    import javax.imageio.IIOImage;
    import javax.imageio.ImageIO;
    import javax.imageio.ImageWriteParam;
    import javax.imageio.ImageWriter;
    import javax.imageio.stream.MemoryCacheImageOutputStream;
    
    import org.zefer.cache.DynamicImageHandler;
    
    public class PD4CanvasHandler extends DynamicImageHandler
    {
    public byte[] getImage(String tagName, int width, int height, String id, HashMap attributes, String onBodyLoad, Vector scriptSections) throws Exception {
    
    System.out.println("canvas ID: " + id);
    System.out.println("onBodyLoad: " + onBodyLoad);
    System.out.println("attributes: " + attributes);
    
    if (scriptSections != null) {
    Iterator ii = scriptSections.iterator();
    while (ii.hasNext()) {
    String js = (String)ii.next();
    System.out.println("
    <hr class="bbcode_rule" />
    ");
    System.out.println( js );
    }
    }
    System.out.println("
    <hr class="bbcode_rule" />
    ");
    
    BufferedImage bi = new BufferedImage(width, height, BufferedImage.TYPE_BYTE_INDEXED);
    Graphics g = bi.getGraphics();
    
    g.setColor( Color.white );
    g.fillRect(0, 0, width, height);
    g.setColor( Color.red );
    g.drawString("Canvas handler test", 30, 30);
    g.dispose();
    
    Iterator iter = ImageIO.getImageWritersByFormatName("png");
    ImageWriter writer = (ImageWriter)iter.next();
    ImageWriteParam iwp = writer.getDefaultWriteParam();
    
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    MemoryCacheImageOutputStream output = new MemoryCacheImageOutputStream(baos);
    writer.setOutput(output);
    IIOImage image = new IIOImage(bi, null, null);
    writer.write(null, image, iwp);
    writer.dispose();
    
    return baos.toByteArray();
    }
    }

    If your idea with RhinoCanvas works, we’ll add a new method to make possible a canvas output in vector form.

    For the time being PD4ML parser is not able to read <script /> tags. It needs explicit opening and closing tags: <script> and </script>

    in reply to: Looking For PD4ML.NET Serve side Header/Footer Display Code
    #28413

    The message tells your application cannot establish a direct HTTP connection with the host. Are you behind a firewall? Don’t you need to define proxy settings?

    in reply to: Looking For PD4ML.NET Serve side Header/Footer Display Code
    #28411

    As I wrote, there are some new Java samples there since few minutes ago.

    OK, PD4ML.NET has PD4Converter.aspx.cs sample, which also takes URL as an parameter.

    You need to add to the sample a section like

    PD4PageMark footer = new PD4PageMark();
    footer.setPageNumberTemplate("page $[page] of $[total]");
    footer.setTitleAlignment(PD4PageMark.LEFT_ALIGN);
    footer.setPageNumberAlignment(PD4PageMark.RIGHT_ALIGN);
    footer.setInitialPageNumber(1);
    footer.setPagesToSkip(1);
    footer.setFontSize(14);
    footer.setAreaHeight(18);
    pd4ml.setPageFooter(footer);

    before
    pd4ml.render(new Uri(inputUrl), outfile);

    in reply to: Looking For PD4ML.NET Serve side Header/Footer Display Code
    #28409

    First, get familiar with 3 ways to define of headers/footers:
    html-pdf-faq-f1/pdf-page-headers-footers-definition-options-t41.html

    Please take into account, that some of the methods work with PD4ML Pro only.

    I’ve just added Java samples there: C# .NET code should be more-less identical. Let us know if there are still open questions.

    in reply to: unix : fonts deployment ?
    #28404

    Please check if the pd4fonts.properties has ttf.fonts.dir entry. Remove it if any.

    in reply to: Google App Engine
    #28425

    PD4ML utilizes many AWT classes, so there is no easy way to implement GAE compatibility.

    PD4ML architecture consists of two layers: HTML renderer and PDF output pseudo-device. The “pseudo-device” implements java.awt.Graphics which makes possible to “print” rendered document layout to a buffered image, for example. Or to capture any graphics output and to generate a PDF from it. A compatibility with GAE would require to sacrifice a lot of useful functions. Also I expect some troubles with TTF fonts.

    in reply to: initialPageNumber
    #28390

    > It is not repeating the <th> section on the next page.

    In the mode it repeats all leading <tr> tags if they consist of <th> tags only.

Viewing 15 posts - 961 through 975 (of 1,410 total)