Forum Replies Created

Viewing 15 posts - 556 through 570 (of 583 total)
  • Author
    Posts
  • in reply to: Creating an index at the end of the pdf file
    #27684

    Hi

    I spent some time looking closer into it, and a some questions arose.

    Most are about the jsp tag lib, considering I’m not used to jsp tags. Are they some rules defining whether the tags should be closed immediately or include the whole document ? Is the order of declaration a matter ? Should parameters always be included in quotes ?

    Currently I’ve :

    <pd4ml:transform screenWidth="400" debug="true" >
    <pd4ml:permissions password="empty" rights="2068" strongEncryption="true">
    <pd4ml:page.break ifSpaceBelowLessThan="500">
    <pd4ml:clean_xhtml/>
    (html doc)
    </pd4ml:page.break>
    </pd4ml:permissions>
    </pd4ml:transform>

    => I’ve tried many other combinations, to no success.

    In this context, only clean_xhtml works… The permissions defined in jsp never worked (I had to do it through Java), neither did the page break feature (for which I found no Java correspondence).

    A more important question is about hyphenation : it’s working but without an hyphen (-) character.
    I currently use CSS :

    p{
    text-align: justify;
    word-wrap:break-word;
    }

    however the breaks occur without hyphen character. Is there a way to define one ?

    I tried to put some h3 with visibility:hidden, in order for the Table Of Content to include link to these items without actually showing it. It doesn’t work.

    However, this is a need for our current usage of a so called index : we have some h3 which are hidden but should be part of the table of content, in order to allow links to the position. Is there a way to do it through the table of content ?

    If the index spoken above was to be created, could it link to keywords which aren’t actually displayed ? Or could it be done through other tricks ?

    I’ll look deeper into PD4ML later, so I could come back with more questions…

    thanks again !

    joseph

    in reply to: Creating an index at the end of the pdf file
    #27682

    Interesting discussion, thanks for your inputs.

    I didn’t find this pd4ml.page tag on the website, but the tag lib api did it (https://www.pd4ml.com/taglib/index.html). Looks like doing the job.

    Regarding our stack design, it comes from one of our needs : to be able to generate mails with pdf attached to them, as a kind of newsletter. Indeed, we could have a request to process 1000+ of such mails, with just a few lines changing from one mail to the others.

    in doing so, we would like to be able to spare the bandwidth as much as possible (and thus we plan to have a templating option) as well as be sure we won’t spoil some web server CPU (and as such being able to produce the pdf in a dedicated server). The templating stuff would be done before the pdf rendering engine.

    hence our aimed architecture. I welcome any advice/feedback.

    As PD4ML looks promising, I’ll now work on a demo implementation, using the trial version. Hopefully it’ll work out as expected and then we could discuss further of the buy and index stuff.

    thanks again
    joseph

    in reply to: Session not transfered when using pd4ml.render()
    #27636

    Was there a resolution to this question?

    I am experiencing the same behavior: when using setSessionID(session.getId()) followed by render() the page that is being rendered has a new session, not the one requested (session.isNew()==true, session.getId() is a new id).

    in reply to: Session not transfered when using pd4ml.render()
    #27634

    Hello PD4ML,
    Could you please provide an email address so that we may contact and deal with your support team directly. This issue is holding up production changes and we can’t afford lengthy delays by waiting on answers to be posted in a forum.

    Previously we had an issue and it was dealt with via email swiftly and attentively. We were hoping it would be a similar case this time. Any knowledge gained outside of the forum can be copied in at a later date.

    Thanks

    in reply to: example emb_utf.jsp is not running
    #27491

    I found the issue. I need to add the file: before the path of fonts directory.

    in reply to: java.lang.StackOverflowError ( pd4ml )
    #27540

    THANK YOU so much !!!

    repeating unclosed tag was the real problem !!!

    Many many thanks !!

    in reply to: Session not transfered when using pd4ml.render()
    #27633

    Just to confirm above statement:

    The page we are trying to display contained in URL is rendered correctly using the render() method. All CSS, images, HTML etc are rendered correctly as per normal. The jsessionid however is not being transferred to the page used in the render() method.

    This means that where session values are displayed on the page, the value is showing as blank. This is because a new session is created by default in which our attributes used on the page don’t exist.

    in reply to: Session not transfered when using pd4ml.render()
    #27632

    The issue is 1. render() cannot load the URL.

    The page is rendered however fields populated by values stored in the jsession are blank.

    in reply to: IMG tag with SRC – HTTPS://
    #27593

    replacing http://www.reachsuite.com with the servers internal IP address had no effect also …

    i think it is to do with the fact the CustomFileResourceProvider java script class/library exists in the notesdatabase and not as an external library like pd4ml so when i specify this class as an extra resource provider is is unable to find it …
    I might try and create/compile this seperate class using a java IDE and compile it that way and put the .java file along side pd4ml library and include it like you would …

    Do you have a working basic example of a notes database with this implemented??

    in reply to: IMG tag with SRC – HTTPS://
    #27591

    Hi,

    After turning on the debug information i got the following:

    AMgr: Start executing agent 'CreateContractPDFs' in 'EAA090114ccoweb.nsf'
    Agent Manager: Agent printing: testing CustomFileResourceProvider.test: test works
    Agent Manager: Agent printing: version: PD4ML 351b17 (eval)
    Agent Manager: Agent printing: image not yet in cache: https://www.reachsuite.com/EAA090114/cxpweb.nsf/PublicDocs/NCOY-7UKH4E/$File/CompanyLogo.gif
    Agent Manager: Agent printing: not yet in cache: https://www.reachsuite.com/EAA090114/cxpweb.nsf/PublicDocs/NCOY-7UKH4E/$File/CompanyLogo.gif
    Agent Manager: Agent printing: External resource loader: CustomFileResourceProvider not found. Make sure "pd4ml.extra.resource.loaders" value is correct
    Agent Manager: Agent printing: External resource loader: CustomFileResourceProvider not found. Make sure "pd4ml.extra.resource.loaders" value is correct
    Agent Manager: Agent printing: resource https://www.reachsuite.com/EAA090114/cxpweb.nsf/PublicDocs/NCOY-7UKH4E/$File/CompanyLogo.gif not found.
    Agent Manager: Agent printing: image https://www.reachsuite.com/EAA090114/cxpweb.nsf/PublicDocs/NCOY-7UKH4E/$File/CompanyLogo.gif not found.
    Agent Manager: Agent printing: can not load image: https://www.reachsuite.com/EAA090114/cxpweb.nsf/PublicDocs/NCOY-7UKH4E/$File/CompanyLogo.gif
    Agent Manager: Agent printing: done in 343ms.
    AMgr: Agent 'CreateContractPDFs' in 'EAA090114ccoweb.nsf' completed execution
    I also added a function test() to CustomFileResourceProvider to return a dummy string and did the following:

    PD4ML pd4ml = new PD4ML();
    pd4ml.setPageInsets(new Insets(20, 10, 10, 10));
    pd4ml.setHtmlWidth(1000);
    pd4ml.setPageSize(format);
    HashMap map = new HashMap();
    map.put( "pd4ml.extra.resource.loaders", "CustomFileResourceProvider" );
    pd4ml.setDynamicParams(map);
    ustomFileResourceProvider obTest = new CustomFileResourceProvider();
    System.out.println("testing CustomFileResourceProvider.test: " + obTest.test());

    The Agent Manager output above shows the CustomFileResourceProvider is available as a class and working. How ever i don’t think this class is available in the java generally available classes.
    I am going to test changing the IP from a web URL to xx.xx.xx.xx but the ResourceProvider as a class doesn’t seem to behave correctly …

    Again anymore help would be great so we can then purchase the unlimited licence.

    in reply to: IMG tag with SRC – HTTPS://
    #27590

    The code for CustomFileResourceProvider is as (creating CustomFileResourceProvider):

    import java.io.BufferedInputStream;
    import java.io.ByteArrayOutputStream;
    import java.io.IOException;
    import java.io.InputStream;
    import java.net.URL;
    import java.net.URLConnection;
    
    import org.zefer.cache.ResourceProvider;
    
    public class CustomFileResourceProvider extends ResourceProvider {
    
    public byte[] getResourceAsBytes(String resource, boolean debugOn) throws IOException {
    ByteArrayOutputStream fos = new ByteArrayOutputStream();
    byte buffer[] = new byte[2048];
    
    InputStream is = null;
    
    //resource = "https://pd4ml.com/i/" + resource;
    
    URL src = new URL(resource);
    URLConnection urlConnect = src.openConnection();
    try {
    urlConnect.connect();
    } catch (Throwable e) {
    return new byte[0];
    }
    is = urlConnect.getInputStream();
    BufferedInputStream bis = new BufferedInputStream(is);
    
    int read;
    do {
    read = is.read(buffer, 0, buffer.length);
    if (read > 0) { // something to put down
    fos.write(buffer, 0, read);
    }
    } while (read > -1);
    
    fos.close();
    bis.close();
    is.close();
    
    return fos.toByteArray();
    }
    }

    I’ll try output diagnostic information next but i think i tried before to output the resource location to see if this appear in the system log and nothing appear which suggested the CustomFileResourceProvider never got used/called.

    What code do i need to add to the above to get it to work with HTTPS locations?

    I also have access to our servers so if they do not resolve the website URL then I will add them to the hosts file so it should. Am i correct in thinking that would solve any resolving issue pd4ml may have??

    in reply to: IMG tag with SRC – HTTPS://
    #27587

    OK I have put in place the newest version of the trial library and i still have the problem of images not rendering on a SSL server.

    Here is the code that performs the pdf creation:

    public static final void generatePDF(String inputHTML, OutputStream fos,
    Dimension format, String fontsDir, String footerBody)
    throws Exception {
    
    // the method uses only basic PD4ML API calls
    // more info:
    // Reference: https://pd4ml.com/reference.htm
    // Javadoc: https://pd4ml.com/api/index.html
    
    PD4ML pd4ml = new PD4ML();
    pd4ml.setPageInsets(new Insets(20, 10, 10, 10));
    pd4ml.setHtmlWidth(1000);
    pd4ml.setPageSize(format);
    
    HashMap map = new HashMap();
    map.put( "pd4ml.extra.resource.loaders", "CustomFileResourceProvider" );
    pd4ml.setDynamicParams(map);
    
    if (fontsDir != null && fontsDir.length() > 0) {
    pd4ml.useTTF(fontsDir, true);
    }
    
    if (footerBody != null && footerBody.length() > 0) {
    PD4PageMark footer = new PD4PageMark();
    footer.setAreaHeight(-1);
    footer.setHtmlTemplate(footerBody);
    pd4ml.setPageFooter(footer);
    }
    
    //		pd4ml.enableDebugInfo(); //	in Lotus environment the debug info appears under
    //		File->Tools->Show Java Debug Console
    pd4ml.render(new StringReader(inputHTML), fos, new URL("file:."), "utf-8");
    fos.flush();
    fos.close();
    }

    This code compiles and executes and still creates a PDF but again with no images. If i copy the HTML that was used to a text file and save it as .html it renders fine in a browser so the HTML is fine …

    Can you provide me with anymore help at all???

    in reply to: IMG tag with SRC – HTTPS://
    #27586

    Ah ok ill try that now.

    The library is not within the database but added to the common librarys used by domino so the library can exist only the once and be available to everyone on that server. How ever, if it was in the local database or not the code wouldn’t compile if the library was not available …

    We are currently testing the use of pd4ml on a live secure server before we can go ahead with it’s use and purchase an unlimited license …

    Changing the library will means i will need to restart the domino service before it will recognise the new library so i will not be able to give feedback until tomorrow.

    The version i am currently using is pd4ml.lib.trial.351b7

    in reply to: page-break-inside: avoid Not Working
    #27554

    This is the code i am using

    PD4ML converter = new PD4ML() ;
    converter.setHtmlWidth(745) ;
    converter.enableTableBreaks(true) ;
    
    converter.render(...) ;

    Still the Table row <tr> that only consist of 3 lines on my generated document got split within two pages, One line on first page and remaining 2 lines on next page.

    Does this functionality works in PD4ML, as stated by supported CSS properties page ? If yes, how ?

    Thanks for your help.

    in reply to: Regarding direct print through default printer & Preview
    #27460

    Hi PD4ML Team,

    First of all Thanks alot for ur quick respose.

    2) Is it possible to open as “PDF Preview mode” that is dynamically generated PDF file by PD4ML for ?

    I want “PDF Preview mode” to restrict the “Print” option in generated PDF.
    it is only for viewing purpose.

Viewing 15 posts - 556 through 570 (of 583 total)