Skip Navigation

[Resolved] Output User Field Values into downloadable PDF

This thread is resolved. Here is a description of the problem and solution.

Problem: I would like to allow my site visitors to download a PDF file that includes some custom user fields.

Solution: Use a View or a Content Template to output the desired custom User field values, and use print stylesheets to style the output. Users can print to PDF using the native browser print features.

Related Documentation: https://codex.wordpress.org/Styling_for_Print

This support ticket is created 3 years, 10 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 2 replies, has 2 voices.

Last updated by GamX 3 years, 10 months ago.

Assisted by: Christian Cox.

Author
Posts
#2034523

Hello, is there a way to display values that the user has input (into custom Toolset User Fields via Toolset User Forms) in a downloadable PDF file? If a plugin is needed, please advise what tends to work well with Toolset.

I know I can display the content I wish using Toolset Views, but the user would have to know how to "print to PDF" and it may print extra info such as headers and sidebars that I don't want to clutter their PDF file.

Thanks for any advice and recommendations!

#2034561

Hi, I'm not aware of any integrations between Toolset and PDF generating plugins, so I don't really have a good recommendation there. Normally I would suggest using Views to output the desired User information in a custom page, and use custom CSS print styles via media queries or custom print stylesheets to style the desired information and hide any extra information you don't want to include in the generated PDF. Some articles about manipulating print styles in WordPress with CSS:
https://codex.wordpress.org/Styling_for_Print
https://code.tutsplus.com/tutorials/quick-tip-adding-a-simple-print-stylesheet-to-wordpress--wp-176
https://torquemag.io/2017/09/make-your-website-printer-friendly/

You would be able to turn off the display of items like the header, footer, main menu, sidebars, page title and meta information, etc. using this technique with the standard browser print function.

#2035833

Thanks Christian, I'll try that approach. Meanwhile, would appreciate it if you could pass this along as a feature request... thank you!