Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

feat(export): add basic metatada to exported PDF #759

Merged
merged 2 commits into from
Nov 25, 2022

Conversation

Envek
Copy link
Contributor

@Envek Envek commented Nov 10, 2022

In #669 pdf-lib dependency was added and an option to process exported PDF to add some info to it.

Why not go further and enhance exported PDF a little bit more, adding basic metadata to it?

Before:

Screenshot from 2022-11-10 21-36-14

After (look at window title):

Screenshot from 2022-11-10 21-34-16

@antfu antfu changed the title Add basic metatada to exported PDF feat(export): add basic metatada to exported PDF Nov 10, 2022
@@ -223,9 +224,18 @@ export async function exportSlides({
preferCSSPageSize: true,
})

// Edit generated PDF: add metadata and (optionally) TOC
let pdfData = fs.readFileSync(output)
Copy link
Member

Choose a reason for hiding this comment

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

Can we use the promises version of fs? Thanks

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure! Done

@Envek Envek requested a review from antfu November 25, 2022 10:32
@antfu antfu merged commit e408c38 into slidevjs:main Nov 25, 2022
@Envek Envek deleted the export/pdf-metadata branch December 13, 2022 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants