Forum Replies Created

Viewing 15 posts - 211 through 225 (of 4,246 total)
  • Author
    Posts
  • in reply to: IMG tag with SRC – HTTPS://
    #27584

    I am using Lotus Domino so this may be the case.

    I have created the above class file and included it as i have with the pd4ml library and it all compiles fine. The following is how i added the resource provider:

    [language=java:1trbjb29]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);[/language:1trbjb29]
    How ever this does not seem to have made any different/affect? I put a System.out.println statement in the Custom Resource Provider to see if it is used and my output never appears ….

    Can you provide me with anymore help??

    Thanks,

    Nick

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

    I guess you use pd4ml_demo.jar pre-installed in the demo lotus notes database.

    The custom resource loaders support feature is relatively new, so I would recommend you to download the most recent version v351b17 from PD4ML download area and install it instead of the default one.

    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: 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:

    [language=java:1rum0qmq]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: http://pd4ml.com/reference.htm
    // Javadoc: http://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();
    }[/language:1rum0qmq]

    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://
    #27588

    The Java code seems to be correct. Now it would be helpful if you post code of your version of CustomFileResourceProvider.

    Of course if you use the original CustomFileResourceProvider sample, it cannot load SSL resources. You need to add SSL connection/loading code there.

    First I would recommend to add

    [language=java:x3knzdo9]System.out.println( “resource request: ” + resource );[/language:x3knzdo9]
    to the class and inspect the server’s log to make sure the loader is called.

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

    By the way: as I see, the images are located on “www.reachsuite.com”. Very often servers have different external (Internet) and internal (intranet) names. “www.reachsuite.com” looks like an external name.

    It is not always true, that the servers within intranet are able to resolve the external names or to establish a connection using the external name.

    Just to make sure that it is not your case, try to temporarily substitute “www.reachsuite.com” in the image URL with its local IP address.

    Also pd4ml.enableDebugInfo(); forces PD4ML to dump connection statistics to STDOUT (or server’s log), which could be also useful to analyze the problem.

    in reply to: PD4ML Tips & Tricks
    #26280

    The attached documents illustrate how to use htmlWidth and pageFormat attributes of

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

    The code for CustomFileResourceProvider is as (creating CustomFileResourceProvider):

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

    Hi,

    After turning on the debug information i got the following:

    [language=xml:1benp1rv]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[/language:1benp1rv]I also added a function test() to CustomFileResourceProvider to return a dummy string and did the following:

    [language=java:1benp1rv]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());[/language:1benp1rv]
    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://
    #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://
    #27592

    Sorry for the delay with the reply.

    > External resource loader: CustomFileResourceProvider not found. Make sure “pd4ml.extra.resource.loaders” value is correct

    Obviously the classloader cannot find CustomFileResourceProvider class (which is expected to be in the classpath)

    Well, your idea to add the class to the pd4ml_demo.jar is not that bad. But before you re-packed the JAR and deployed it to the Domino environment, try to debug CustomFileResourceProvider offline. You may run PD4ML in GUI mode:

    java -Xmx512m -cp .;pd4ml_demo.jar;ss_css2.jar -Dpd4ml.extra.resource.loaders=CustomFileResourceProvider org.zefer.pd4ml.tools.PD4Browser

    (The application will auto-create pd4browser.properties. In the file you may set debug.info.enable=true to allow the debug output)

    You would also need to add to the classpath the specific domino SSL lib(s)

    in reply to: Using taglib in other language than JSP or Coldfusion ?
    #27445

    You (may) specify the default page format, orientation etc with PD4ML API calls.

    attributes allow to change the default settings on-a-fly.

    in reply to: General questions / FAQ
    #26282

    I need to generate pdf for few html summary pages. And the html summary page will be available only for authenticated users.
    How can we generate pdf for authenticated urls ?

    in reply to: General questions / FAQ
    #26281

    Hi!

    Is there possibility to reset page numbers inside document, eg. in tag. The problem is that I have one big HTML file, but I want page numbers to be local like:
    page 1 of 3
    page 2 of 3
    page 3 of 3
    … and then … eg. page 1 of 2
    page 2 of 2

    instead of
    page 1 of 5
    page 2 of 5
    page 3 of 5
    page 4 of 5
    page 5 of 5

    Thanks in advance for reply.

    in reply to: Troubleshooting
    #26283

    My sample HTML like this :

      Department  EMPLOYEE  SCHEDULED  WORKED  Last Name  First Name  Emp ID  Phone Number  Shift  Hours  Shift  Hours 

    And i am setting enableTableBreaks property ‘True’. My application deployed in glassfish server. And my pdf contains more than one page.

    In PDF, first page showing double headers properly. From second page onwards, second header not getting displayed i.e Last Name, First Name, Emp Id, Phone Number etc header. But first header displaying properly. i.e. Department, EMPLOYEE, SCHEDULED, WORKED header.

    Can you please let me know why this issue coming in glassfish server. It’s properly working when my application deployed in tomcat.

    Please check the attached Image “SecondHeaderMissing_pdf2.GIF” for clarification.

Viewing 15 posts - 211 through 225 (of 4,246 total)