Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #26325

    Dear Sirs,

    I am trying to render a PDF on a server other than the web server.

    I need to access a resource such as g:/acme/web/ (css or images)
    such that I would get the following result
    file:/g:/acme/web/images/dot_000000.png

    I have tried the following with the each result listed:
    URL base = new URL(“file:/g:/acme/web);
    image not yet in cache: file:/images/dot_000000.png

    URL base = new URL(“file://g:/acme/web”);
    not yet in cache: file://g:/images/dot_000000.png

    URL base = new URL(“file://g://acme//web”);
    not yet in cache: file://g:/images/dot_000000.png

    URL base = new URL(“file:///g://acme//web”);
    not yet in cache: file:/images/dot_000000.png

    URL base = new URL(“file:///g:/acme/web”);
    not yet in cache: file:/images/dot_000000.png

    Every time it appears that the “acme/web” is dropped from the path. Can you point me to the correct Base URL format?

    Thank you,
    Mica

    #27830

    URL base = new URL(“file:/g:/acme/web);

    should work if the image SRC defined as “images/image.png”, not as “/images/image.png”

    #27831

    The css and images are stored root web folder like “/images/image.png”.

    How can this be resolved?

    #27832

    An information regarding the mapping of the root web folder to the physical file system is known only to the web application container. So the container/server should be somehow taken into the path resolving. There are two methods:

    • Request the resources via HTTP. In your case it is going to be a definition of URL base = new URL(“http://yourserver/”);
    • Let PD4ML to talk to the server directly with pd4ml.useServletContext(ServletContext ctx)
    #27833

    For now, modifying the html with the following works to remove the leading slash

    [language=java:2cbj9nop]data = data.replaceAll(“src=”/images/”, “src=”images/”);
    data = data.replaceAll(“href=”/style/”, “href=”style/”);[/language:2cbj9nop]
    and the following javascript in the page will set a ‘checked’ into the html

    [language=Java:2cbj9nop]function processFormData(oForm) {
    var e, i = 0;
    while (e = oForm.elements[i++]) {
    if (e.type == 'checkbox') {
    if (e.checked == true) {
    e.defaultChecked = true;
    } else {
    e.defaultChecked = false;
    }
    }
    if (e.type == 'radio') {
    var x = e.name;
    if (e.checked == true) {
    e.defaultChecked = true;
    } else {
    e.defaultChecked = false;
    }
    }
    }
    }[/language:2cbj9nop]

    #27834

    I am afraid the trick with JavaScript is not going to work. PD4ML does not support JavaScript. The source HTML should already have “CHECKED” attributes on their places.

    #27835

    Actually,
    This code is working quite well. It is executed on the client browser prior to getting the copy of the HTML. I refactored the code and am reposting it :

    function processFormData(oForm) {
    var e, i = 0;
    while (e = oForm.elements[i++]) {
    if (e.type == ‘checkbox’ || e.type == ‘radio’) {
    if (e.checked == true) {
    e.defaultChecked = true;
    } else {
    e.defaultChecked = false;
    }
    }
    if (e.type == ‘select’) { // Still needs to be done
    }
    }
    }

Viewing 7 posts - 1 through 7 (of 7 total)

The forum ‘HTML/CSS rendering issues’ is closed to new topics and replies.