I've been trying to figure this out for several days now, and would like to be able to eliminate (or not) Prince as a possible solution.
My environment:
I'm working in a CMS that generates PDFs using Prince. (I'm not sure what version, but assume the latest for right now).
I CAN:
I CANNOT:
Use Case:
We have a page where the users can select from a drop-down menu listing about 20 product solutions to see spec tables for that product. They can select one product, several, or all.
When they click "submit", Javascript on the page builds/returns the tables they selected, hides the ones they didn't. Pretty simple.
However, we'd like them to be able to create a PDF showing just those tables -- they don't like having a pdf with 20 tables when they are only interested in 6. Similarly, they don't want to go to 6 different pages and print each one individually.
Question:
Is there a way to do this with Prince (without access to the CLI)? From my initial reading of the user guides and testing, it doesn't seem that there is a way.
e.g. I don't want to have a script execute when the user opens the document ("prince-pdf-script"). It sounds like "prince-script" lets you add some generated plain text strings, but I'm not sure how/if that could work here, given that we're trying to respond to a user selection.
But then I ran across an answer on StackOverflow. It was posted several years ago, but says it also dealt with rendered HTML and Prince:
This sounds like something I might be able to work with, but I can't find any documentation anywhere on how to go about doing it/what is possible/what isn't/etc.
If it's not possible, I'd just like to know so that I can focus on seeing how we can incorporate a solution like jsPDF (at least on pages like this).
(I'm also just very confused as this seems like an incredibly common use case and I can't find much discussion anywhere. Part of me suspects it's so obvious and simple that no one ever bothers discussing it....)
My environment:
I'm working in a CMS that generates PDFs using Prince. (I'm not sure what version, but assume the latest for right now).
I CAN:
- Add Javascript to the page
- Modify the Prince CSS
I CANNOT:
- Access the Prince CLI (However, I'm willing to hassle our CMS account rep about enabling/disabling certain things)
Use Case:
We have a page where the users can select from a drop-down menu listing about 20 product solutions to see spec tables for that product. They can select one product, several, or all.
When they click "submit", Javascript on the page builds/returns the tables they selected, hides the ones they didn't. Pretty simple.
However, we'd like them to be able to create a PDF showing just those tables -- they don't like having a pdf with 20 tables when they are only interested in 6. Similarly, they don't want to go to 6 different pages and print each one individually.
Question:
Is there a way to do this with Prince (without access to the CLI)? From my initial reading of the user guides and testing, it doesn't seem that there is a way.
e.g. I don't want to have a script execute when the user opens the document ("prince-pdf-script"). It sounds like "prince-script" lets you add some generated plain text strings, but I'm not sure how/if that could work here, given that we're trying to respond to a user selection.
But then I ran across an answer on StackOverflow. It was posted several years ago, but says it also dealt with rendered HTML and Prince:
Render your html in the browser such as Chrome first. Get the entire document (not the source but actual rendered document) saved into html file and then use it as input to prince. You can get entire rendered document from browser javascript console.
This sounds like something I might be able to work with, but I can't find any documentation anywhere on how to go about doing it/what is possible/what isn't/etc.
If it's not possible, I'd just like to know so that I can focus on seeing how we can incorporate a solution like jsPDF (at least on pages like this).
(I'm also just very confused as this seems like an incredibly common use case and I can't find much discussion anywhere. Part of me suspects it's so obvious and simple that no one ever bothers discussing it....)