Forum Replies Created

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • in reply to: image not rendered in PDF
    #29550

    I specify problem:

    My html code:

    <table>
    <tr>
    <td>
    <img alt="Image from the forum topic: image not rendered in PDF" src="xxx/image1.png"/>
    </td>
    </tr>
    </table>

    working css:

    img {
    width: auto;
    height: auto;
    vertical-align: middle;
    border: 0;
    -ms-interpolation-mode: bicubic;
    }

    NOT working css:

    img {
    width: auto9;
    height: auto;
    max-width: 100%;
    vertical-align: middle;
    border: 0;
    -ms-interpolation-mode: bicubic;
    }

    in reply to: tag ‘span’ and "class" attribute
    #29472

    Same problem with tables:

    <body>
    <table>
    <tr>
    <td><span class="label label-success">Some text1</span>
    </td>
    <td>
    ups
    <span class="label label-success">Some text2</span>
    </td>
    </tr>
    </table>
    </body>

    I can see only “Some text2” in PDF/RTF.

    in reply to: tag ‘span’ and "class" attribute
    #29471

    @PD4ML wrote:

    Can you publish a minimalistic example, which illustrates the issue?

    Yes, i did it.

    This is source page:

    <!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><head><title>Title</title><meta content="Apache Tapestry Framework (version 5.3.7)" name="generator"/><meta content="text/html; charset=utf-8" http-equiv="content-type"/><link type="text/css" rel="stylesheet" href="/assets/1.0-SNAPSHOT/core/default.css"/><link type="text/css" rel="stylesheet" href="/assets/1.0-SNAPSHOT/jquery/themes/ui-lightness/jquery-ui-1.8.19.custom.css"/><style>
    label,
    input,
    button,
    select,
    textarea {
    font-size: 14px;
    font-weight: normal;
    line-height: 20px;
    }
    label {
    display: block;
    margin-bottom: 5px;
    }
    .label,
    .badge {
    display: inline-block;
    padding: 2px 4px;
    font-size: 11.844px;
    font-weight: bold;
    line-height: 14px;
    color: #ffffff;
    text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
    white-space: normal;
    vertical-align: baseline;
    background-color: #999999;
    }
    .label:empty,
    .badge:empty {
    display: none;
    }
    .label {
    -webkit-border-radius: 3px;
    -moz-border-radius: 3px;
    border-radius: 3px;
    }
    .label-success,
    .badge-success {
    background-color: #468847;
    }
    .label-success[href],
    .badge-success[href] {
    background-color: #356635;
    }
    .btn .label,
    .btn .badge {
    position: relative;
    top: -1px;
    }
    .btn-mini .label,
    .btn-mini .badge {
    top: 0;
    }
    </style></head><body><span class="label label-success">Some text</span></body></html>

    “Some text” isn’t printed into final pdf/rtf

    BUT if I replace <body> a bit:
    <body>Some text<span class="label label-success">Some text</span></body>

    I can see BOTH “Some text” strings into pdf/rtf

    in reply to: changePageOrientation in RTF
    #29455

    @PD4ML wrote:

    Portrait:
    pd4ml.setPageSize( PD4Constants.A4 );
    Landscape:
    pd4ml.setPageSize( pd4ml.changePageOrientation( PD4Constants.A4 ) );

    Yes, i use always second type, but it have no effect:

    private static int PDF = 1;
    private static int RTF = 2;
    
    @Test
    public void pd4TestRun() throws Exception {
    convert(<path>, "C:\result.rtf", RTF);
    convert(<path>, "C:\result.pdf", PDF);
    }
    
    private void convert(String input, String output, int type) throws Exception {
    FileOutputStream fos = new FileOutputStream(new File(output));
    
    PD4ML pd4ml = new PD4ML();
    if (type == RTF) pd4ml.outputFormat(PD4Constants.RTF);
    pd4ml.setPageSize(pd4ml.changePageOrientation(PD4Constants.A4));
    pd4ml.setPageInsets(new Insets(20, 20, 20, 20));
    pd4ml.setHtmlWidth(1024);
    pd4ml.disableHyperlinks();
    pd4ml.useTTF("java:fonts", true);
    pd4ml.setDefaultTTFs("Times New Roman", "Arial", "Courier New");
    InputStream is = new FileInputStream(new File(input));
    InputStreamReader inputStreamReader = new InputStreamReader(is);
    pd4ml.render(inputStreamReader, fos, new File(input).toURL());
    fos.close();
    }

    This code generate 2 files (attached to this message). But PDF is landscape, and RTF is portrait.
    I need landscape both.

    in reply to: changePageOrientation in RTF
    #29453

    Thank you for your fast answer

    Attached file is .RTF, but it have landscape orientation in Word 2007 and OpenOffice 4.0.1 at my computer

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