I think the export to PDF deserves an improved handling of toggle blocks. The problem:
Blocks are printed in a way that if they are collapsed in editor, the content inside of them is not visible in PDF. I think the wanted behaviour would be to expand all block before export to not miss any content.
HOW COULD IT BE DONE
We need to decide if this should be optional behaviour or should be the default. As far as I know, Notion handles this automatically and therefore a PDF contains all of the objects content.
REAL WORLD USE CASES
Frictionless export to PDF without the extra hassle to manually expand all toggle blocks before export.
RECOMMENDED ALTERNATIVES
Manually expand all toggle blocks before export.
ADDITIONAL CONTEXT
Those pictures illustrate the difference between collapsed and expanded toggles in PDF.
Hi @jannis, thanks for yet another good contribution to the forum
I personally think the current behavior is intentional and, as you suggest, any change to this should be optional with the following reasoning:
Usually, we you export to PDF, it is for the reason to have an easy to share (immutable) copy of the current state of the document/Object. Otherwise, export to a different format like .md would be favorable. Therefore, I suspect the following logic would better suit the export (or print to PDF) option:
Add an option to collapse or expand all toggles on the page, similar to this request,
Ask the user whether collapsed toggles should be expanded upon exporting to PDF if applicable,
Add the option to check a box to “don’t ask again”,
Add an option in the settings to reset this behavior.
Hi @sambouwer. Thanks! I started to really enjoy it here and to push things forward with the help of community. Really appreciate all the effort you and the other moderators put into the forum
You definitely got a valid point here. I agree that it probably should be optional. There might be some cases where you really want to keep toggles collapsed.
So if we would want to add this functionality both to the editor as well as print to PDF, option 1 would probably be the best solution. That would be handy for sure.
I like the other ones as well, I just think you have to consider the amount of user prompts when exporting. For advanced users might be clear but for newer ones adding more and more options for export might become overwhelming. To avoid that, you could only prompt if the object contains toggle blocks at all.
I thought about this one quite a long time and was surprised no one came up earlier with that request (besides the request you linked, of course). So in the end I would like to hear what the product team thinks is the most user friendly and approach to implement it. I am sure @ignatovv will come up with a great solution.
Though this request did not gain as much traction as other feature request and is rather new, I think from a technical standpoint this is rather easy to implement. Should work fine by:
traversing the tree of blocks
check all toggles and temporarily set their value to ‘expanded’
print to pdf
and restore the original state of the object
I think the last one is important as well. If there is a way to expand all toggles, there has to be a way to collapse all at once. It would be nightmare to collapse everything manually afterwards.