How to set size of iframe exactly to content


I would like to display only the PDF without the background. It probably would be possible to through HTML and CSS but I was wondering if there is some API for viewing only the document/

Hello, I’m Ron, an automated tech support bot :robot:

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:


Hi m.dousa,

Thank you for reaching WebViewer forums.

If you mean the grey space background around the PDF, then you can expand the fit mode by using this API: PDFTron WebViewer Namespace: UI

Best Regards,
Kevin Kim
Web Development Support Engineer
PDFTron Systems, Inc.