How-To add automatically the title of the page in the PDF?

Permalink Browser Info Environment
Is there a way to do that?

Thanks in advance.

Type: Discussion
Status: New
Styves
View Replies:
jstrong replied on at Permalink Reply
jstrong
Hello! It automatically grabs the name of the collection and sets the PDF title property to that.

Do you mean as content? (say, as the first line in the outputted PDF) If that's what you mean let me know and I'll see what I can do! -J
Styves replied on at Permalink Reply
Styves
Yes I mean what you said at the last instance.
jstrong replied on at Permalink Reply
jstrong
Quick, easy dirty way that might work for ya - keeping in mind the following:

Since I haven't tested this and haven't built any customization, I don't want to add this to the production package - but I can walk you through how to add it yourself if you're comfortable making a change to the code on your installed server.

When I do release the next update it will overwrite these changes if you update, and I still may not have a customization option for this once it happens, meaning you'd need to do it again after the update.

Those things being said, if you know how to "get to" your installation folder for concrete5. If you are able to do that it's very easy: open the following file:

/packages/trans_marine_save_area_to_pdf/blocks/save_area_to_pdf/controller.php

On line 62, you'll find:

$htmlToSave = ob_get_clean();

change that to:

$htmlToSave = $c->getCollectionName().ob_get_clean();

save the file. Note there is a period '.' between getCollectionName() and ob_get_clean

Save that, and the name of the page will end up as the first line of the output PDF the next time you click the block. I tried this myself, but again YMMV. Good luck -J

When I've got some down time I'll be revisiting this project and adding other enhancements.
Styves replied on at Permalink Reply
Styves
Thanks a lot. I will try it and give you a feedback.

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.