Get a Free Trial
GrabzIt's Online Community

How to create multipage pdf document from web page with dynamic content?

Ask questions on how to capture or convert web pages or HTML into images, MP4. CSV, PDF or DOCX documents as well on how to convert videos into animated GIF's using our API.

There are no forum posts on this topic! Why don't you write one?

Hi. I need to convert web page with all styles and a lot of dynamic content to .pdf document. It means that .pdf document can have 1 or 2 or more pages and I don't know how many contents can be in different cases. But .pdf document trims all content longer than one page. How can I convert my page to a multipage pdf document?

Asked by Dawie Harmse on the 4th of October 2019

Please can you send the URL so we can have a look at it.

Answered by GrabzIt Support on the 4th of October 2019

What URL do You mean? I use ConvertPage method:  GrabzIt(this.GRABZIT_KEY).ConvertPage({'target': '#someId','format': 'pdf','download': 1,'cache': 0,'filename': username,'bheight': -1,'height': -1,'waitfor': '#someId'}).Create();

Answered by Dawie Harmse on the 4th of October 2019

Ok, I think I see what the problem is. You are using the target feature this can't work across two pages. You can either increase the page size or just pass the html you want to convert to the ConvertHTML method.

Answered by GrabzIt Support on the 4th of October 2019

Ok, but I need to convert my web page with a lot of styles. How it is possible with ConvertHTML method?

Answered by Dawie Harmse on the 4th of October 2019

You would need to remove the parts you aren't interested in while keeping the styles.

Alternatively use the target parameter use the hide parameter which can remove elements you don't need.

Or just specify a large web page size, which wil then be chopped to size by the target.

Answered by GrabzIt Support on the 4th of October 2019