140
Views
3
Comments
HTML TO PDF

I need to Download the HTML document's body as it is on the screen. I tried a few versions. 

1. I wrote the function where I tried to just print the window but hide some elements also used @media print selector for that window and appended all html . It didn;t work.

2. I found two libraries jsPDf which only gives me the possibility to print one page. I can also add Pages but then I have to somehow find out where the first-page HTML breaks and continue from there exactly. I also tried to break my divs in numbers like 2-3 of them and append but visual is not likable and also, I don;t know what will add up on the page in the future. Second library is Html2pdf library which's code works in my personal browser but do not works in the work browser.


Hope some experienced people will share their knowledge here.

Sincerely

2025-04-17 05-42-16
Ajit Kurane

Hi Nino,

What does mean HTML document's body  ?

can you please share sample snapshot that you are expecting as output ?

I am not fully understand your requirement even though I would like to share one demo file where you can download screen as pdf. 

I have done this using Ultimate pdf forge component

Thanks,

Ajit Kurane.

download as pdf.oml
UserImage.jpg
Nino Gachechiladze

Thank you for sharing. I have problem with downloading it. Forge do not open in Service Studio. Hope I'll be able to see it soon

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.