Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

HTML to PDF: CSS Paged media module

Contributor ,
Feb 04, 2025 Feb 04, 2025

Does anyone know which CSS paged media module properties are supported by HTML to PDF API? Is there documentation for this somewhere?

 

Margins seems to work, boxes not:

@page {

	/* works */
	margin-top: 15mm;
	margin-bottom: 15mm;
	margin-left: 15mm;
	margin-right: 15mm;

	/* no result */
	@bottom-center {
		content: "– " counter(page) " –";
	}
}

 

Or better work with pagedjs.

 

Thanks
Roland

140
Translate
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

correct answers 1 Correct answer

Community Expert , Feb 04, 2025 Feb 04, 2025

At the time of this writing the API supports Level 2.

The API also works with pagedjs for some features. Unfortunately, pagedjs sometimes creates invalid HTML that the browsers just kind of ignore but our API can't. I've not been able to work around these HTML errors.

Translate
Community Expert ,
Feb 04, 2025 Feb 04, 2025

At the time of this writing the API supports Level 2.

The API also works with pagedjs for some features. Unfortunately, pagedjs sometimes creates invalid HTML that the browsers just kind of ignore but our API can't. I've not been able to work around these HTML errors.

Translate
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
Contributor ,
Feb 04, 2025 Feb 04, 2025

Thanks for the answer and your experience, good to know.

Translate
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 ,
Feb 04, 2025 Feb 04, 2025

To test what works, use pagedjs and view the generated page. Then save the HTML and open that in an editor. You'll see the errors immediately. Most have to do with calculated values. I even tried editing the source of pagedjs and couldn't get it to work.

Translate
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
Contributor ,
Feb 04, 2025 Feb 04, 2025
LATEST

I'm not going to try pagedjs after what you've written. Margins and page-break-before, - after is working fine. Maybe Adobe will extend this at some point.

Translate
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 ,
Feb 04, 2025 Feb 04, 2025
You can go to on one of the websites from the European Union
Translate
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
Resources