Mechanism for Page Break and Table of Content

New Here ,
Mar 24, 2021 Mar 24, 2021

Copy link to clipboard

Copied

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.
Screenshot (25).png 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?

Views

136

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 24, 2021 Mar 24, 2021

Copy link to clipboard

Copied

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.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 26, 2021 Mar 26, 2021

Copy link to clipboard

Copied

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.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 26, 2021 Mar 26, 2021

Copy link to clipboard

Copied

LATEST

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. 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines