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

Import PDF in A4 format for better export experience #77

Open
tobias0409 opened this issue Jul 3, 2024 · 2 comments
Open

Import PDF in A4 format for better export experience #77

tobias0409 opened this issue Jul 3, 2024 · 2 comments
Labels
enhancement New feature or request prec:high High priority issues.

Comments

@tobias0409
Copy link

Is your feature request related to a problem? Please describe.
I want to import an A4 PDF file into js-draw. Each page should be automatically scaled to fit perfectly on an A4 page when I export the Markdown file to a PDF (via Joplin?).

Describe the solution you'd like
The end result should be a nice, annotated PDF. Each PDF page should be exactly one page when exported after editing. Assuming that the imported PDF was also A4 should make it easier?

Additional context
As a computer science student, I often have exercise sheets in PDF format with tables to fill in or blank areas for calculations. It would be great to import the PDF file, make the changes and then export it as the same PDF file as before.

@tobias0409 tobias0409 added the enhancement New feature or request label Jul 3, 2024
@personalizedrefrigerator personalizedrefrigerator added the prec:high High priority issues. label Jul 3, 2024
@personalizedrefrigerator
Copy link
Owner

personalizedrefrigerator commented Jul 3, 2024

Fixing this issue through js-draw or the Joplin plugin

Here are a few possible approaches for fixing this issue:

  • (Via Joplin): Support inserting each PDF page as a cropped view of the same resource.
    • This could be done by inserting multiple <img tags into the Joplin markdown source, cropping each with the style attribute.
    • Issue: Moving PDF pages in the js-draw canvas after import would break the cropped views.
  • Finish implementing and merge feat: Support PDF annotation #67.
    • This would not allow mixing Joplin text content with js-draw drawings, but would allow editing arbitrary PDFs in js-draw without the need for import/export.
    • Issue: Exporting the containing note to PDF from Joplin would show only the first page (as is done with other embedded PDFs). The PDF, however, could be saved/exported separately.
  • (Partial fix) Implement multi-page printing with ctrl-p.
    • I suspect that this would be the simplest to implement of the approaches listed here.

Workaround

The end result should be a nice, annotated PDF. Each PDF page should be exactly one page when exported after editing. Assuming that the imported PDF was also A4 should make it easier?

In the markdown editor, provided that the js-draw image is perfectly cropped to the original PDF pages, it should be possible to export to PDF by adding the following CSS to the end of a note, then exporting the note to PDF:

<style>
	/* Assumes that the Joplin note contains a single image */
	img { width: 100vw; }
	@page {
		size: auto; /* Change this to a4 or letter to match the original document size. */
		margin: 0;
	}
	* {
		margin: 0 !important;
		padding: 0 !important;
	}
</style>

@tobias0409
Copy link
Author

tobias0409 commented Sep 8, 2024

Thank you for considering my feature request! I really appreciate the effort that goes into improving this awesome plugin. While reflecting on my use of the plugin, a few more ideas came to mind that I believe could further enhance the workflow, especially for those working with large PDFs and annotations.

  • Embed only the first page of PDFs: It would be great to have a setting that allows embedding only the first page of a PDF. When working with large documents, embedding all pages could make the note in Joplin incredibly bulky.

  • Mobile upload support: Since many users, myself included, prefer to annotate PDFs directly on tablets using a stylus, it would be very helpful to be able to upload PDFs via mobile devices. This would allow for a smoother workflow on the go without having to switch between devices.

  • Add pages for handwritten notes: Instead of writing handwritten notes next to the PDF page (which would probably not be printable), it would be great to have the ability to insert blank pages before or after any existing PDF page. This would allow users to add handwritten notes directly in the PDF flow, using the same format and layout as the original document. My suggestion would be to add a blank image with a dark border the same size as the PDF before/after. Being able to expand the workspace while maintaining print compatibility would be a huge productivity boost.

  • Finite whiteboard: When starting a drawing, select fininite whiteboard and choose the paper size (e.g. A4). It should be possible to add pages before/after the current page and navigate through them. It would help to create nice looking PDFs after export without the need to import a blank PDF.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request prec:high High priority issues.
Projects
None yet
Development

No branches or pull requests

2 participants