Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Export as PDF #1091

Merged
merged 37 commits into from
Jan 31, 2025
Merged

Export as PDF #1091

merged 37 commits into from
Jan 31, 2025

Conversation

eliandoran
Copy link
Contributor

@eliandoran eliandoran commented Jan 31, 2025

Exporting asPDF_image

On the desktop application of Trilium it is possible to export a note as PDF. On the server or PWA (mobile), the option is not available due to technical constraints and it will be hidden.

To print a note, select the 1_Exporting asPDF_image button to the right of the note and select Export as PDF.

Afterwards you will be prompted to select where to save the PDF file. Upon confirmation, the resulting PDF will be opened automatically.

Should you encounter any visual issues in the resulting PDF file (e.g. a table does not fit properly, there is cut off text, etc.) feel free to report the issue. In this case, it's best to offer a sample note (click on the 1_Exporting asPDF_image button, select Export note → This note and all of its descendants → HTML in ZIP archive). Make sure not to accidentally leak any personal information.

Landscape mode

When exporting to PDF, there are no customizable settings such as page orientation, size, etc. However, it is possible to specify a given note to be printed as a PDF in landscape mode by adding the #printLandscape attribute to it.

Page size

By default, the resulting PDF will be in Letter format. It is possible to adjust it to another page size via the #printPageSize attribute, with one of the following values: A0, A1, A2, A3, A4, A5, A6, Legal, Letter, Tabloid, Ledger.

Keyboard shortcut

It's possible to trigger the export to PDF from the keyboard by going to Keyboard Shortcuts and assigning a key combination for the exportAsPdf action.

@eliandoran eliandoran changed the title Different printing mechanism & print as PDF for Electron Export as PDF Jan 31, 2025
@eliandoran eliandoran marked this pull request as ready for review January 31, 2025 23:27
@eliandoran eliandoran requested a review from pano9000 January 31, 2025 23:27
Copy link
Contributor Author

@eliandoran eliandoran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@eliandoran eliandoran merged commit c09ef76 into develop Jan 31, 2025
5 checks passed
@eliandoran eliandoran deleted the feature/different_printing_mechanism branch January 31, 2025 23:35
@d3v19
Copy link

d3v19 commented Feb 21, 2025

Amazing addition making Trilium even more feature rich!! Until now, I have been turning on share toggle and printing it as a pdf from the browser. I suppose if the share feature could be reutilized for the PDF export in this case, but the share UI needs to be further enhanced for decent visual reproduction in the PDF.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants