Skip to main content
zulkifel
Participant
March 24, 2021
Question

Mechanism for Page Break and Table of Content

  • March 24, 2021
  • 2 replies
  • 786 views

Hi Developer Community, 
I am currently using  Adobe PDF Tools API in order to create PDFs from HTML and CSS. 
I come across a problem with the page break and table of content.
In the attachment given below, you can see the image is starting from one page and extended to the next page.
 Since the HTML is created dynamically and will be processed in the background service, thus we cannot see generated HTML and CSS. Is there any provided mechanism/function in PDF Tool API that allows you to break/continue a particular HTML section?

Secondly, The issue we faced is the creation of a Table of Content. Does Adobe PDF Tool API create a Table of Content? Like List of Page Title and Page Number associated to it?

    This topic has been closed for replies.

    2 replies

    zulkifel
    zulkifelAuthor
    Participant
    March 26, 2021

    Thanks for the reply, but in our real-world case, HTML will be generated dynamically as a background service, compressed as a ZIP, and will be passed to Adobe PDF API. Thus we cannot see generated HTML and cannot determine whether the Image is contained within 1 page or more.

    Joel Geraci
    Community Expert
    Community Expert
    March 26, 2021

    Understood. That's why there are flexible rules to the CSS. My recommendation is to style the images or their containers set to...

    page-break-inside: avoid;

    This should keep all images on one page. 

    Joel Geraci
    Community Expert
    Community Expert
    March 24, 2021

    You can control page breaking using CSS Paged Media properties. I've put a few examples below.

    page-break-before: auto;
    page-break-before: always;
    page-break-before: avoid;
    page-break-before: left;
    page-break-before: right;
    page-break-before: recto;
    page-break-before: verso;

     

    As for the TOC, we don't have support for that yet.