Jump to content

Save certain parts of a web page as pdf?


AyRestaurant

Recommended Posts

I want to add this button that says "save as pdf" but obviously dont want that button to appear on the pdf.

 

So is there a way to only save like "parameters" of the page as a pdf document?

 

Ex. Invoicebubble - when editing the invoice

 

any coding ideas??? php, ajax, java???

Link to comment
https://forums.phpfreaks.com/topic/223441-save-certain-parts-of-a-web-page-as-pdf/
Share on other sites

What are you using to convert the page to a PDF? If that process uses the "print" output of the page to generate the PDF then there is a simple solution. CSS allows you to specify different styles for elements based upon the "media". I have used this may times in the past to have elements such as the navigation section not display in the printed output (the navigation links have no purpose in a printed output).

 

For any elements that you do not want in the printed output, give them a display property of none for the "print" media. Here is an old post where I provided some example code: http://www.phpfreaks.com/forums/javascript-help/print-function!/msg1093659/#msg1093659

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.