This is an archived forum post. The information may be outdated. Contact us if you have any questions.

Page Break not working

wglass wrote on 2015-06-30:

I'm using the API and finding that page breaks are ignored. Specifically, my page to be printed has

<div style="page-break-after:always"></div>

When I print from the form on your home page, this works.

When I call the API as below, this does not properly do a page break. I read somewhere that webkit needs the print media type to be on -- is this required? The docs don't say what value to set it to ("on" or "true" - I tried both).

Any suggestions?


<form target="_blank" id="convert-form" action="" method="post">
    <input id="convert_src" type="hidden" name="src" size="80">
    <input type="hidden" name="conversion_source" value="uri">

    <input type="hidden" name="width" value="8.5 in"/>
    <input type="hidden" name="height" value="11.0 in"/>
    <input type="hidden" name="margin_top" value="0.2 in"/>
    <input type="hidden" name="margin_left" value="0.2 in"/>
    <input type="hidden" name="margin_right" value="0.2 in"/>
    <input type="hidden" name="margin_bottom" value="0.2 in"/>
    <input type="hidden" name="pdf_scaling_factor" value="1" />

    <input type="hidden" name="use_print_media" value="true"/>

    <input type="hidden" name="username" value="xx"/>
    <input type="hidden" name="key" value="xx"/>
wglass wrote on 2015-06-30:

I cleaned up my HTML and this was fixed. Specifically, I wrapped each page in a div tag, then it worked.

Oddly, before this change it printed from the browser properly. But it wouldn't do the PDF paging properly until I wrapped each page in the div.