zsviczian / obsidian-excalidraw-plugin

A plugin to edit and view Excalidraw drawings in Obsidian
4.24k stars 233 forks source link

BUG: Embedded Excalidraw notes get caught when exporting to PDF #1235

Open fgsanz opened 1 year ago

fgsanz commented 1 year ago

Your environment SYSTEM INFO: Obsidian version: v1.3.5 Installer version: v1.3.4 Operating system: Darwin Kernel Version 22.5.0: Thu Jun 8 22:22:22 PDT 2023; root:xnu-8796.121.3~7/RELEASE_X86_64 22.5.0 Login status: logged in Catalyst license: none Insider build toggle: off Live preview: on Legacy editor: off Base theme: adapt to system Community theme: none Snippets enabled: 3 Restricted mode: off Plugins installed: 20 Plugins enabled: 18 1: Dataview v0.5.56 2: Excalidraw v1.9.5 3: Banners v1.3.3 4: Clear Unused Images v1.1.0 5: ExcaliBrain v0.1.15 6: Kindle Highlights v1.9.2 7: Media Extended v2.11.1 8: MySnippets v1.2.3 9: Novel word count v2.17.1 10: Number Headings v1.8.1 11: Reading Time v1.1.1 12: Recent Files v1.3.6 13: Table of Contents v0.2.0 14: Templater v1.16.0 15: Vault Statistics v0.1.3 16: Book Search v0.5.10 17: Settings Search v1.3.7 18: Note Refactor v1.7.1

RECOMMENDATIONS: Custom theme and snippets: for cosmetic issues, please first try updating your theme and disabling your snippets. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community theme and snippets. Community plugins: for bugs, please first try updating all your plugins to latest. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community plugins.

Describe the bug I made a note with several drawing in Excalidraw, and when I export to PDF those drawings get cut and I only see a portion of them.

To Reproduce Steps to reproduce the behavior:

  1. Make a note with Excalidraw embbeds which are "vertically long"
  2. Export to PDF
  3. Bug!

Expected behavior Two possible expectations:

  1. Option 1 - The best - Just continue the drawing in the next PDF page, drawing does not get resized
  2. Option 2 - Very much less desired, but better that current bug - Shrink the drawing until it fits in one page

Screenshots I am attaching:

With this two you can see how the PDF is cut. This one goes in the PDF section "3 The 1-2-3 move".

Additional context Your tools are great, thank you very much! 👍

zsviczian commented 1 year ago

At this time Obsidian does not inform plugins if the image is being generated for output to PDF or just for screen. Thus the cutting is performed by Obsidian. One option in your case is to use frames and embed frames in your document like this. I will include a list of images, hopefully, self-explanatory, but please ask if you have questions. (btw, thinking about this has triggered two feature ideas that I will record separately (#1237 and #1238).

Starting point:

the drawing

image

the markdown embed

image

the PDF

image

Adding frames:

image

Copying the frame reference:

image

image

Embedding the frame in the document:

image

The exported PDF:

image

fgsanz commented 1 year ago

Hello!

Thanks for answering back so soon. I added some comments here, please check: https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/1238

Thanks, F

On Sun, Jul 23, 2023 at 6:50 AM zsviczian @.***> wrote:

At this time Obsidian does not inform plugins if the image is being generated for output to PDF or just for screen. Thus the cutting is performed by Obsidian. One option in your case is to use frames and embed frames in your document like this. I will include a list of images, hopefully, self-explanatory, but please ask if you have questions. (btw, thinking about this has triggered two feature ideas that I will record separately (#1237 https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/1237 and

1238

https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/1238). Starting point: the drawing

[image: image] https://user-images.githubusercontent.com/14358394/255374561-e63a6329-501e-45a4-93a4-038186d8b7e3.png the markdown embed

[image: image] https://user-images.githubusercontent.com/14358394/255374573-859a90e4-4fa7-4791-823a-87bf3d5f7f33.png the PDF

[image: image] https://user-images.githubusercontent.com/14358394/255374711-40408b26-5b88-4d28-b475-729169d0f7b4.png Adding frames:

[image: image] https://user-images.githubusercontent.com/14358394/255374600-266b2de6-e0cf-4d45-bca8-dd8fe18cd9ac.png Copying the frame reference:

[image: image] https://user-images.githubusercontent.com/14358394/255374740-27029918-b816-4e7d-b4dd-1b449ba312c9.png

[image: image] https://user-images.githubusercontent.com/14358394/255374745-a7c10469-a75c-41c4-a458-ed019dcfe60e.png Embedding the frame in the document:

[image: image] https://user-images.githubusercontent.com/14358394/255374665-74b1ead5-78d7-424f-b817-17ec203518a4.png The exported PDF:

[image: image] https://user-images.githubusercontent.com/14358394/255374765-39d139bc-b77e-4dfb-aef3-04ecaee84a38.png

— Reply to this email directly, view it on GitHub https://github.com/zsviczian/obsidian-excalidraw-plugin/issues/1235#issuecomment-1646745615, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB4Q4O6XCST2NNM6HCTA2ITXRSUPTANCNFSM6AAAAAA2TWZ2UI . You are receiving this because you authored the thread.Message ID: @.***>