You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
canvas.toBlob(blob=>blob ? resolve(blob) : reject(newError('Image blob failed')),`image/${this.settings.imageType}`,0.9);// 0.9 is only for lossy formats
77
+
});
78
+
79
+
// Explicitly clean up PDF.js resources (optimization)
80
+
page.cleanup();
81
+
82
+
// Force browser to dump canvas bitmap (optimization)
83
+
canvas.width=0;
84
+
canvas.height=0;
85
+
86
+
constimageName=`page_${pageNum}.${this.settings.imageType}`;// Get image name
87
+
constimagePath=`${folderPath}/${imageName}`;// Full path for image in vault
88
+
constarrayBufferImg=awaitblob.arrayBuffer();// Convert Blob to ArrayBuffer for Obsidian Vault
Copy file name to clipboardExpand all lines: README.md
+8-3Lines changed: 8 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@
3
3
Convert PDF pages into images and insert them directly into your Obsidian notes. Optionally, extract headers from each page and add or empty lines below each image for quick and easy-to-annotate notes.
@@ -16,12 +16,16 @@ Convert PDF pages into images and insert them directly into your Obsidian notes.
16
16
17
17
## Settings
18
18
-**Image Quality**: Adjust the image quality to suit your needs. The default setting is 1x, but you can reduce it to as low as 0.5x for smaller file sizes and improved performance, or increase it up to 2x for the highest image clarity.
19
-
19
+
-**Image Type**: Choose the format for the inserted images. Options include:
20
+
- WEBP: Modern format that balances quality and file size effectively.
21
+
- JPEG: Lossy format, suitable for smaller file sizes.
22
+
- PNG: Lossless format, best for high-quality images.
23
+
20
24
-**Image Insertion Method**: Choose between two different methods for inserting images:
21
25
- Procedural: Images are generated and inserted one at a time.
22
26
- Batch: All images are generated first, then inserted simultaneously for a more streamlined process.
23
27
24
-
-**Image seperator**: You can customize how images are separated: choose an empty line, a separator line, or no separation at all.
28
+
-**Image separator**: You can customize how images are separated: choose an empty line, a separator line, or no separation at all.
25
29
26
30
-**Insert headers**: Toggle the option on to generate headers for each image based on pdf page analysis. This feature is in early development, so its effectiveness may vary depending on the PDF layout. I’m actively working to improve the algorithm to better detect different header types.
27
31
@@ -33,6 +37,7 @@ Convert PDF pages into images and insert them directly into your Obsidian notes.
33
37
- Increase this value if headers are not being detected correctly.
34
38
- Lower the value if non-headers are mistakenly being detected as headers.
35
39
40
+
-**Max Concurrent Pages**: Set the maximum number of pages to process concurrently. This can help improve performance but may also increase memory usage.
36
41
37
42
## Support
38
43
This plugin is free for everyone. If you'd like to show your appreciation or support further development, feel free to send a contribution my way:<br>
0 commit comments