GithubHelp home page GithubHelp logo

ryotaushio / obsidian-pdf-plus Goto Github PK

View Code? Open in Web Editor NEW
367.0 3.0 7.0 113.66 MB

The most Obsidian-native PDF annotation, viewing & editing tool ever.

Home Page: https://ryotaushio.github.io/obsidian-pdf-plus/

License: MIT License

JavaScript 0.22% TypeScript 97.58% CSS 1.89% Python 0.31%
obsidian pdf pdf-annotation pdf-editor pdf-generation obsidian-plugin

obsidian-pdf-plus's Introduction

Obsidian PDF++

Obsidian Downloads

This is an Obsidian.md plugin for a better PDF experience. Specifically:

  • It transforms backlinks to PDF files into highlight annotations, i.e. you can annotate PDF files with highlights just by linking to text selection.
  • Alternatively, you can add annotations directly into PDF files so that they are also visible outside Obsidian.
  • Moreover, it adds many quality-of-life improvements to the built-in PDF viewer and PDF embeds. So it's useful even if you don't use it as an annotation tool (you can even turn off the annotation functionality!).

PDF++ stands out among other PDF annotation tools for the following reasons:

  • PDF++ acts as a complement to Obsidian's native PDF viewer rather than replacing it. It allows you to make sidenotes as pure markdown, so you will not lose your annotations even if the plugin stops working as long as Obsidian is alive. It will not leave behind a pile of unreadable JSON even if this plugin stops working in the future, unlike Annotator.

    I'm not a fan of .md files that are actually not markdown at all. The value of the markdown format does not lie in the file extension!

  • PDF++ makes Obsidian work as a stand-alone PDF annotation tool. You can seamlessly annotate your PDFs using Obsidian's rich markdown editor without switching between Obsidian and an external app like Zotero or Marginnote.
  • Annotations for a single PDF are no longer confined to a single file and can be distributed across the whole vault. It establishes a novel, Obsidianic way of PDF annotation.
  • PDF++ does not introduce plugin-dependent syntaxes except for a few optional ones (&color=.../&rect=... link parameters).

🚀 Install
📖 Read the docs (Note: it's still a work in progress!)
💬 Ask & answer questions
Report bugs (Tip: when something is not working, first restart Obsidian by running the Reload app without saving command.)

Note

  • If you like this plugin, don't forget to star this repository! I'd also appreciate it if you could support me.
  • Some features require the Style Settings plugin enabled.

Warning

This plugin relies on many private APIs of Obsidian, so there is a relatively high risk that this plugin may break when Obsidian is updated (learn more). For this reason, I hope this plugin's functionalities will be natively supported by Obsidian itself so that we won't need this plugin anymore.

Getting started

Here I'm just scratching the surface of what PDF++ can do. See below and the plugin settings in Obsidian for more details. Also note that each feature can be toggled on and off in the plugin settings, which lets you customize this plugin to best fit into your use case.

Link to PDF files to annotate them with highlights

link-to-annotate.mov

Color palette for easily copying links & specifying highlight colors

color-palette.mov

Copy links quickly via a hotkey

copy-link-hotkey.mov

Seamless integration with other community plugins

Blazingly fast workflow with Hover Editor

It's also friendly to laptops with small display sizes. See here for the details.

Screen.Recording.2024-02-09.at.21.02.19.mov

Transform the backlinks pane into ZotLit-like annotation view with Better Search Views & PDF++ callouts

See here for the details.

image

Highly customizable copy formats

template.mov

Rectangular selection embeds

Learn more

Screen.Recording.2024-03-02.at.14.40.20.mov

Ctrl/Cmd+hover over highlights to preview or open backlinks

Depends on the Action when hovering over highlighted text setting.

Preview

hover-to-preview.mov

Open

hover-to-open.mov

Filter backlinks by page

Show only backlinks to the page that is currently opened in the PDF viewer.

filter-backlink.mov

"Hover sync" between PDF viewer & backlinks pane

hover-sync.mov

Features

Each feature can be toggled on and off in the plugin settings.

Backlink highlighting

Annotate PDF files with highlights just by linking to text selection. You can easily copy links to selections using color palette in the toolbar. See the "Color palette" section for the details.

  • Highlight backlinks in PDF viewer: In the PDF viewer, any referenced text will be highlighted for easy identification.
    • By default, all backlinks are highlighted. However, there is an option that allows you to highlight only backlinks with colors specified in the link text (see below).
    • It does not modify the PDF file itself. It just changes how the file content is displayed in Obsidian. PDF++ also offers an option to add highlights to PDFs directly.
  • Custom highlight colors: Append &color=<COLOR NAME> to a link text to highlight the selection with a specified color.
    • <COLOR NAME> is one of the colors that you register in the plugin settings. e.g [[file.pdf#page=1&selection=4,0,5,20&color=red]]
    • Color names are case-insensitive, i.e. all of &color=red, &color=RED and even &color=rEd work the same.
    • You can use the color palette in PDF toolbars to easily copy links with &color=... appended automatically. See the "Color palette" section for the details.
    • You can also opt not to use this plugin-dependent notation and apply a single color (the "default highlight color" setting) to all highlights.
  • Easily navigate to backlinks by pressing Ctrl/Cmd (by default) while hovering over a highlighted text in PDF viewer: you can choose what happens when you hover over a highlighted text between the following:
    • Open backlink
    • Popover preview of backlink
  • Double click a piece of highlighted text to open the corresponding backlink

PDF++ callouts

Create callouts with the same color as the highlight color without any CSS snippet scripting.

Backlink pane improvements

These features make Obsidian a unique PDF annotation tool that tightly connects PDFs to your ideas stored as markdown files.

  • Filter backlinks by page: Show only backlinks to the page that is currently opened in the PDF viewer.
  • Hover sync (PDF viewer → Backlinks pane): Hovering over highlighted text or annotation will also highlight the corresponding item in the backlink pane.
  • Hover sync (Backlinks pane → PDF viewer): In the backlinks pane, hover your mouse over a backlink item to highlight the corresponding text or annotation in the PDF viewer.

Editing PDF files directly (experimental)

Add, edit, and delete highlights and links in PDF files. Added annotations will be visible even outside Obsidian, unlike backlink highlights.

PDF++ will not modify PDF files themselves unless you explicitly allow it. The author assumes no responsibility for any data corruption. Please make sure you have a backup and use it at your own risk. Report any issues you encounter here.

PDF page composer: PDF counterpart of the "Note Composer" core plugin

Add, insert, remove or extract PDF pages via commands and automatically update related links in the entire vault.

Add, rename, move and delete PDF outline items (a.k.a. table of contents / bookmarks)

Allow PDF modification and right-click on the PDF outline. Alternatively, you can use the command "Add to outline" to add a new item, or drag & drop outline items to move it under another item.

Edit page labels

Learn more

PDF internal links enhancement

Make it easier to work with internal links embedded in PDF files.

  • Show a popover preview of PDF internal links by hover+command/ctrl: See below for advanced CSS customization.
  • Enable history navigation for PDF internal links: When enabled, clicking the "navigate back" (left arrow) button will take you back to the page you were originally viewing before clicking on an internal link in the PDF file.
  • Copy PDF link as Obsidian link: (Requires custom right-click menu enabled) In the PDF viewer, right-click a PDF-embedded link and then click "Copy PDF link as Obsidian link". It will copy the PDF link as an Obsidian link that you can paste into markdown files. Clicking the pasted link will take you to the same destination as the original PDF link.
  • "Copy link to current page view" command: Running this command while viewing a PDF file will copy a link, clicking which will open the PDF file at the current scroll position and zoom level.
  • Paste copied link to a text selection in a PDF file: (Requires custom right-click menu & PDF editing enabled) After copying a link by the above actions, you can "paste" it to a selection in PDF to create a PDF internal link. To do this, right-click the selection and click "Paste copied link to selection".

Opening links to PDF files

Open PDF links cleverly

  • Don't open a single PDF file in multiple tabs: When opening a link to a PDF file without pressing any modifier keys, a new tab will not be opened if the same file has already been opened in another tab. Useful for annotating PDFs using a side-by-side view ("Split right"), displaying a PDF on one side and a markdown file on another.
    • You can optionally highlight the existing tab to enhance visual feedback.
  • Open PDF links next to the existing PDF tab: If there is a PDF file opened in a tab, clicking a PDF link will first create a new tab next to it and then open the target PDF file in the created tab. This is especially useful when you are splitting the workspace vertically or horizontally and want PDF files to be always opened on one side.
  • Don't move focus to PDF viewer after opening a PDF link
  • Open PDF links with an external app: See below for the details.

Other options

  • Always record navigation history when opening PDF links: By default, the history is recorded only when you open a link to a different PDF file. If enabled, the history will be recorded even when you open a link to the same PDF file as the current one, and you will be able to go back and forth the history by clicking the left/right arrow buttons even within a single PDF file.
  • Open PDF link instead of showing popover preview when target PDF is already opened: Press Ctrl/Cmd while hovering a PDF link to actually open it if the target PDF is already opened in another tab.
  • Clear highlights after a certain amount of time
  • Ignore the height parameter in popover preview: Obsidian lets you specify the height of a PDF embed by appending &height=... to a link, and this also applies to popover previews. Enable this option if you want to ignore the height parameter in popover previews.

Copying links to PDF files

Copy links with ease

  • Color palette in PDF toolbar: A color palette will be added to the toolbar of the PDF viewer. Clicking a color while selecting a range of text will copy a link to the selection with &color=... appended.
    • You can customize the format of copied text using a powerful templating system (see below).
  • Copy link to selection or annotation command: This command allows you to trigger the copy-link action specified in a dropdown menu in the PDF toolbar quickly via a hotkey. I recommend using Ctrl+Shift+C/Cmd+Shift+C.
  • Copy & auto-paste link to selection or annotation command: In addition to copying a link, this command automatically pastes the copied link at the end of the note where you last pasted a link.

    Note: these commands cannot be triggered from the Command Palette. Make sure that you set custom hotkeys for them.

  • Toggle "select text to copy" mode icon in the left ribbon menu: While it's turned on, the Copy link to selection or annotation command will be triggered automatically every time you select a range of text in a PDF viewer, meaning you don't even have to press a hotkey to copy a link.

Copy PDF internal links as Obsidian links

See here for the details.

Link copy templates

You can customize the template format that will used when copying a link to a selection or an annotation in PDF viewer. Each {{...}} in the template will be evaluated as a JavaScript expression with many variables available. See the plugin settings for the details.

  • Custom display text format
  • Custom color palette actions: Customize the commands that you can trigger by clicking a color palette item while selecting a range of text in PDF viewer.
  • Use another template when no text is selected: For example, you can use this to copy a link to the page when there is no selection.

Right-click menu options

Customize the behavior of Obsidian's built-in right-click menu in PDF view.

  • Copy link with/without display text: When copying a link to a selection or an annotation in a PDF file, Obsidian appends |<PDF FILE TITLE>, page <PAGE NUMBER> to the link text by default. This plugin allows you to disable this behavior if you don't like it.
  • Display text format: You can customize the display text format.

Copy link to section from PDF outline (table of contents)

  • Replace the built-in right-click menu in the outline with a custom one: This enables you to copy a section link with a custom format by right-clicking an item in the outline.
  • Drag & drop outline item to copy link to section: Grab an item in the outline and drop it to a markdown file to create a section link.

Copy link to page from PDF thumbnail

  • Replace the built-in right-click menu in the thumbnail with a custom one: This enables you to copy a page link with a custom display text format specified in the PDF toolbar by right-clicking a thumbnail.

    Note: The Minimal theme has an issue where thumbnails cannot be right-clicked to open a menu when combined with Style Settings (details).

  • Drag & drop PDF thumbnail to copy link to section: Grab a thumbnail image and drop it to a markdown file to create a page link.

    Note: When disabled, drag-and-drop will cause the thumbnail image to be paste as a data url, which is seemingly Obsidian's bug.

Embedding PDF files

  • Click PDF embeds to open links: Clicking a PDF embed will open the embedded file.
  • Trim selection embeds: When embedding a selection from a PDF file, only the selection and its surroundings are displayed rather than the entire page.
    • You can specify the margin as well.
  • Hide toolbar in PDF embeds with a page specified: Requires the Style Settings plugin.
  • Never show sidebar in PDF embeds
  • Don't display PDF embeds or PDF popover previews in "two page" layout: Regardless of the "two page" layout setting in existing PDF viewer, PDF embeds and PDF popover previews will be always displayed in "single page" layout. You can still turn it on for each embed by clicking the "two page" button in the toolbar, if shown.
  • Don't highlight text in a text selection embeds/don't highlight annotations in an annotation embeds
  • Don't clear highlights in a selection/annotation embeds
  • Make PDF embeds unscrollable
  • Zoom in PDF embeds (experimental)

Keyboard shortcut commands

PDF++ offers the following commands for reducing mouse clicks on the PDF toolbar by assigning hotkeys to them.

  • Show outline / show thumbnail
  • Close PDF siderbar
  • Zoom in / zoom out
  • Fit width / fit height
  • Go to page: This command brings the cursor to the page number input field in the PDF toolbar. Enter a page number and press Enter to jump to the page.
  • Show copy format menu / show display text format menu: By running thes commands via hotkeys and then using the arrow keys you can quickly select a format from the menu without using the mouse.
  • Enable PDF edit / disable PDF edit

Integration with external apps (desktop-only)

  • Open PDF links with an external app: Open PDF links with the OS-defined default application for PDF files. You can choose whether the same PDF file should be opened in Obsidian as well.
  • Sync the external app with Obsidian: When you focus on a PDF file in Obsidian, the external app will also focus on the same file.

Misc

  • Render markdown in sticky notes

CSS customization

You can customize the styling of various components of PDF++ using CSS snippets.

Text highlights

Here is a list of CSS selectors to target:

  • .textLayer .mod-focused: Obsidian's native text selection highlights shown when opening links to text selections in PDFs
  • .annotationLayer .mod-focused: Obsidian's native annotation highlights shown when opening links to annotations in PDFs
  • .pdf-plus-backlink-highlight-layer .pdf-plus-backlink: PDF text highlights that PDF++ generates from backlinks
    • Use .pdf-plus-backlink-highlight-layer .pdf-plus-backlink[data-highlight-color="<COLOR NAME>"] to target a specific color
  • .pdf-plus-backlink-highlight-layer .pdf-plus-backlink.hovered-highlight: PDF text highlights that PDF++ generates when you hover over an item in the backlinks pane

Callout colors

The highlight colors that you define in the Highlight colors setting are also available as CSS variables. For example, a color named "Yellow" will be converted into a variable --pdf-plus-yellow-rgb. Its value is a tuple of the RGB values, e.g. 255, 208, 0. Note that non-alphanumeric characters are replaced with hyphens in variable names. For example, a color with name "Super LONG name!!" will result in a variable name --pdf-plus-super-long-name-rgb.

Additionally, the color specified in the Default highlight color setting is also available as --pdf-plus-default-color-rgb.

You can use these CSS variables for various purposes. For example, you can create a callout whose color matches the highlight color in the PDF viewer.

1. Different colors within a single callout type

Here we use a callout type "PDF" as an example, but it can be anything you like.

Copy format:

> [!PDF|{{colorName}}] {{linkWithDisplay}}
> {{text}}

Result example:

> [!PDF|yellow] [[file.pdf#page=1&selection=0,1,2,3&color=yellow|file, page 1]]
> Lorem ipsum

> [!PDF|red] [[file.pdf#page=1&selection=0,1,2,3&color=red|file, page 1]]
> Lorem ipsum

> [!PDF|] [[file.pdf#page=1&selection=0,1,2,3|file, page 1]]
> Lorem ipsum

or without pipe ("|") after the callout type ("PDF"):

> [!PDF] [[file.pdf#page=1&selection=0,1,2,3|file, page 1]]
> Lorem ipsum

CSS snippet:

.callout[data-callout="pdf"][data-callout-metadata="yellow"] {
    --callout-color: var(--pdf-plus-yellow-rgb);
}

.callout[data-callout="pdf"][data-callout-metadata="red"] {
    --callout-color: var(--pdf-plus-red-rgb);
}

.callout[data-callout="pdf"] {
    --callout-color: var(--pdf-plus-default-color-rgb);
}

2. Color by callout types

Another approach is to associate each highlight color to a specify callout type such as "Note" or "Important".

Copy format:

> [!{{colorName}}] {{linkWithDisplay}}
> {{text}}

Result example:

> [!note] [[file.pdf#page=1&selection=0,1,2,3&color=note|file, page 1]]
> Lorem ipsum

> [!important] [[file.pdf#page=1&selection=0,1,2,3&color=important|file, page 1]]
> Lorem ipsum

CSS snippet:

.callout[data-callout="note"] {
    --callout-color: var(--pdf-plus-note-rgb);
}

.callout[data-callout="important"] {
    --callout-color: var(--pdf-plus-important-rgb);
}

Popover preview of PDF internal links

Sometimes, You may find preview popovers too tall.

For example, suppose you're reading a LaTeX-generated paper. You can hover over an inline citation (e.g. "Author et al., 2024") to show a popover preview of the corresponding entry in the bibliography section. Since a bib entry is not that tall, the popover often has too much vertical space.

Now, use the following CSS snippet to remove the extra space:

.pdf-plus-pdf-internal-link-popover[data-dest^="cite."] {
    --my-height: 200px; /* Change this to your liking */
    height: var(--my-height) !important;
    top: calc(var(--popover-height) - var(--my-height)) !important;
}

The data-dest attribute is the ID of the named destination (i.e. link target) that the internal link points to, which starts with cite. for bibliographic items. In general, you can get the ID by the following steps:

  • Press command+option+I (macOS) / Ctrl+Shift+I (windows) to open the developer tool.
  • Click the arrow icon at the top-left corner of the dev tool to enter the inspection mode.
  • Click the PDF internal link that you want to inspect. Then, an <a> element will be highlighted in the "Elements" tab of the dev tool.
  • The href attribute of the <a> element is the destination ID with a hash sign (#) prepended.

You can also find a great tutorial on the forum.

Installation

You can install this plugin from within Obsidian's community plugin browser.

Alternatively, you can try the cutting-edge, latest beta release using BRAT.

  1. Install the latest version of BRAT and enable it.
  2. (Optional but highly recommended) In the BRAT settings, turn on Auto-update plugins at startup at the top of the page.
  3. Open the following URL in the browser: obsidian://brat?plugin=RyotaUshio/obsidian-pdf-plus.
  4. Click the "Add Plugin" button.

Credits

PDF++ is built on top of Obsidian's native PDF viewer powered by Mozilla's PDF.js, which is already pretty good even without PDF++. Without the awesome work of the Obsidian team and the PDF.js maintainers, PDF++ would not have been possible.

PDF++ extends the native viewer by using monkey-around, an awesome patching library by PJ Eby. It is used by countless Obsidian plugins and has been helping the community as an infrastructure providing a foundation of Obsidian's high extendability. He's also the author of several popular Obsidian plugins including Tag Wrangler.

PDF++ offers two ways to highlight text in PDF: one that does not involve modifying the PDF file, and the other that writes highlight annotations directly into the PDF file. The latter is powered by the pdf-lib, a JavaScript library for creating and modifying PDF documents. The original project was created by Andrew Dillon. PDF++ uses a forked version maintained by Cantoo Scribe.

Compatibility

I'm trying to keep PDF++ compatible with the following plugin(s) as much as possible:

The following plugin(s) alters Obsidian's internals in such a way that prevents some aspects of other plugins from working properly, so I don't recommend using it together with this plugin.

Development principles

  • Always stick around Obsidian's built-in PDF viewer.
  • Don't introduce plugin-dependent stuff as much as possible.
    • It can be tolerated only if
      • it brings a massive benefit
      • and it won't leave anything that becomes just a random mess without this plugin.

Support development

If you find my plugins useful, please support my work to ensure they continue to work!

GitHub Sponsors

Buy Me A Coffee

Buy Me a Coffee at ko-fi.com

obsidian-pdf-plus's People

Contributors

ryotaushio avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

obsidian-pdf-plus's Issues

Auto-focus cannot detect the last pasted .md file on Windows

Hey,
so I did some more testing and the behaviour was consistent in the sandbox vault as well in my productive vault:

  • Opening the hover editor using auto focus opens a new hover editor, which is the command to be carried out when no corresponding md file can be found. However even if I had a specific file open and pasted before the hover editor sill only opens a new window instead of the last active and pasted one
  • This problem does not turn up when I have my note open in the sidebar. Then everything workes like a charm

Here are the debug logs, hope they help. Let me know if I can do further testing for you.

SYSTEM INFO: Obsidian version: v1.5.3 Installer version: v1.5.3 Operating system: Windows 10 Enterprise 10.0.19045 Login status: not logged in Insider build toggle: off Live preview: on Base theme: dark Community theme: Atom v0.0.0 Snippets enabled: 4 Restricted mode: off Plugins installed: 25 Plugins enabled: 25 1: Kanban v1.5.3 2: Tag Wrangler v0.6.1 3: ProZen v0.3 4: Iconize v2.10.0 5: Projects v1.17.1 6: Paste image rename v1.6.1 7: Dataview v0.5.64 8: Citations v0.4.5 9: QuickAdd v1.7.0 10: Git v2.23.2 11: Pandoc Reference List v2.0.25 12: Pandoc Plugin v0.4.1 13: Callout Manager v1.0.1 14: Editor Syntax Highlight v0.1.3 15: BRAT v0.8.4 16: PDF++ v0.35.21 17: Style Settings v1.0.7 18: Annotator v0.2.11 19: Hotkey Helper v0.3.18 20: Zotero Integration v3.1.7 21: Better Search Views v0.2.2 22: BibNotes Formatter v0.9.219 23: Omnisearch v1.21.1 24: Text Extractor v0.5.1 25: Hover Editor v0.11.17

{ "settings": { "displayTextFormats": [ { "name": "Title & page", "template": "{{file.basename}}, p.{{page}}" }, { "name": "Page only", "template": "p.{{pageLabel}}" } ], "defaultDisplayTextFormatIndex": 0, "syncDisplayTextFormat": true, "syncDefaultDisplayTextFormat": false, "copyCommands": [ { "name": "Copy as quote", "template": "> {{selection}}\n\n{{linkWithDisplay}}" }, { "name": "Copy link to selection", "template": "{{linkWithDisplay}}" }, { "name": "Copy embed of selection", "template": "!{{link}}" }, { "name": "citation allout", "template": "> [!{{calloutType}}|{{colorName}}] {{selection}} {{linkWithDisplay}}\n>" }, { "name": "highlight callout ", "template": "> [!{{calloutType}}|{{colorName}}] {{linkWithDisplay}}\n>" }, { "name": "nw", "template": "> [!{{calloutType}}|{{colorName}}] {{linkWithDisplay}}\n>" } ], "useAnotherCopyTemplateWhenNoSelection": false, "copyTemplateWhenNoSelection": "{{linkToPageWithDisplay}}", "trimSelectionEmbed": true, "embedMargin": 18, "noSidebarInEmbed": true, "noSpreadModeInEmbed": true, "embedUnscrollable": false, "singleTabForSinglePDF": true, "highlightExistingTab": true, "existingTabHighlightOpacity": 0.5, "existingTabHighlightDuration": 1, "paneTypeForFirstPDFLeaf": "left", "openLinkNextToExistingPDFTab": true, "openPDFWithDefaultApp": false, "openPDFWithDefaultAppAndObsidian": true, "focusObsidianAfterOpenPDFWithDefaultApp": true, "syncWithDefaultApp": false, "dontActivateAfterOpenPDF": true, "dontActivateAfterOpenMD": true, "highlightDuration": 0, "noTextHighlightsInEmbed": false, "noAnnotationHighlightsInEmbed": true, "persistentTextHighlightsInEmbed": true, "persistentAnnotationHighlightsInEmbed": false, "highlightBacklinks": true, "dblclickEmbedToOpenLink": true, "highlightBacklinksPane": true, "highlightOnHoverBacklinkPane": true, "backlinkHoverColor": "", "colors": { "info": "#ffd000", "method": "#346aea", "disagree": "#f04242", "agree": "#2ebf2b" }, "defaultColor": "info", "defaultColorPaletteItemIndex": 1, "syncColorPaletteItem": true, "syncDefaultColorPaletteItem": false, "colorPaletteInToolbar": true, "noColorButtonInColorPalette": false, "colorPaletteInEmbedToolbar": false, "showStatusInToolbar": true, "highlightColorSpecifiedOnly": false, "doubleClickHighlightToOpenBacklink": true, "hoverHighlightAction": "preview", "paneTypeForFirstMDLeaf": "right-sidebar", "singleMDLeafInSidebar": true, "alwaysUseSidebar": true, "defaultColorPaletteActionIndex": 4, "syncColorPaletteAction": true, "syncDefaultColorPaletteAction": false, "proxyMDProperty": "PDF", "hoverPDFLinkToOpen": false, "ignoreHeightParamInPopoverPreview": true, "filterBacklinksByPageDefault": true, "enableHoverPDFInternalLink": true, "recordPDFInternalLinkHistory": true, "alwaysRecordHistory": true, "renderMarkdownInStickyNote": true, "enalbeWriteHighlightToFile": false, "author": "", "writeHighlightToFileOpacity": 0.5, "defaultWriteFileToggle": false, "syncWriteFileToggle": true, "syncDefaultWriteFileToggle": false, "enableAnnotationDeletion": true, "warnEveryAnnotationDelete": false, "warnBacklinkedAnnotationDelete": true, "enableAnnotationContentEdit": true, "enableEditEncryptedPDF": false, "pdfLinkColor": "#04a802", "pdfLinkBorder": false, "replaceContextMenu": true, "executeBuiltinCommandForOutline": true, "executeBuiltinCommandForZoom": true, "executeFontSizeAdjusterCommand": true, "closeSidebarWithShowCommandIfExist": true, "outlineDrag": true, "outlineContextMenu": true, "outlineLinkDisplayTextFormat": "{{file.basename}}, {{text}}", "outlineLinkCopyFormat": "{{linkWithDisplay}}", "recordHistoryOnOutlineClick": true, "popoverPreviewOnOutlineHover": true, "thumbnailDrag": true, "thumbnailContextMenu": true, "thumbnailLinkDisplayTextFormat": "{{file.basename}}, page {{pageLabel}}", "thumbnailLinkCopyFormat": "{{linkWithDisplay}}", "recordHistoryOnThumbnailClick": true, "popoverPreviewOnThumbnailHover": false, "annotationPopupDrag": true, "useCallout": true, "calloutType": "PDF", "calloutIcon": "highlighter", "highlightBacklinksInEmbed": false, "highlightBacklinksInHoverPopover": false, "highlightBacklinksInCanvas": true, "clickPDFInternalLinkWithModifierKey": true, "clickOutlineItemWithModifierKey": true, "clickThumbnailWithModifierKey": true, "focusEditorAfterAutoPaste": true, "autoFocus": true, "autoFocusTarget": "last-active-and-open-then-last-paste", "autoPasteTarget": "last-active-and-open-then-last-paste", "openAutoFocusTargetIfNotOpened": true, "howToOpenAutoFocusTargetIfNotOpened": "hover-editor", "closeHoverEditorWhenLostFocus": true, "closeSidebarWhenLostFocus": true, "openAutoFocusTargetInEditingView": true, "executeCommandWhenTargetNotIdentified": true, "commandToExecuteWhenTargetNotIdentified": "obsidian-hover-editor:open-new-popover", "selectToCopyToggleRibbonIcon": true, "autoFocusToggleRibbonIcon": true, "viewSyncFollowPageNumber": true, "viewSyncPageDebounceInterval": 0.3, "openAfterExtractPages": true, "howToOpenExtractedPDF": "tab", "warnEveryPageDelete": false, "warnBacklinkedPageDelete": true, "extractPageInPlace": false, "askExtractPageInPlace": true, "pageLabelUpdateWhenInsertPage": "keep", "pageLabelUpdateWhenDeletePage": "keep", "pageLabelUpdateWhenExtractPage": "keep", "askPageLabelUpdateWhenInsertPage": true, "askPageLabelUpdateWhenDeletePage": true, "askPageLabelUpdateWhenExtractPage": true, "copyOutlineAsListFormat": "{{linkWithDisplay}}", "copyOutlineAsListDisplayTextFormat": "{{text}}", "copyOutlineAsHeadingsFormat": "{{text}}\n\n{{linkWithDisplay}}", "copyOutlineAsHeadingsDisplayTextFormat": "p.{{pageLabel}}", "copyOutlineAsHeadingsMinLevel": 2, "newFileNameFormat": "", "newFileTemplatePath": "", "newPDFLocation": "current", "newPDFFolderPath": "", "pageLabelUpdateWhenDividePDFs": "keep", "askPageLabelUpdateWhenDividePDFs": true, "alias": true, "writeFileLibrary": "pdfAnnotate", "auther": "", "clickEmbedToOpenLink": true }, "styleSheet": ".pdf-plus-backlink-highlight-layer .pdf-plus-backlink:not(.hovered-highlight)[data-highlight-color=\"info\"],\n.pdf-embed[data-highlight-color=\"info\"] .textLayer .mod-focused {\n background-color: #ffd000;\n}\n.pdf-plus-backlink-highlight-layer .pdf-plus-backlink:not(.hovered-highlight)[data-highlight-color=\"method\"],\n.pdf-embed[data-highlight-color=\"method\"] .textLayer .mod-focused {\n background-color: #346aea;\n}\n.pdf-plus-backlink-highlight-layer .pdf-plus-backlink:not(.hovered-highlight)[data-highlight-color=\"disagree\"],\n.pdf-embed[data-highlight-color=\"disagree\"] .textLayer .mod-focused {\n background-color: #f04242;\n}\n.pdf-plus-backlink-highlight-layer .pdf-plus-backlink:not(.hovered-highlight)[data-highlight-color=\"agree\"],\n.pdf-embed[data-highlight-color=\"agree\"] .textLayer .mod-focused {\n background-color: #2ebf2b;\n}\n.pdf-plus-backlink-highlight-layer .pdf-plus-backlink:not(.hovered-highlight) {\n background-color: #ffd000;\n}\n.pdf-plus-backlink-highlight-layer .pdf-plus-backlink.hovered-highlight {\n\tbackground-color: green;\n}\n.pdf-plus-color-palette-item[data-highlight-color=\"info\"] > .pdf-plus-color-palette-item-inner {\n background-color: #ffd000;\n}\n.pdf-plus-color-palette-item[data-highlight-color=\"method\"] > .pdf-plus-color-palette-item-inner {\n background-color: #346aea;\n}\n.pdf-plus-color-palette-item[data-highlight-color=\"disagree\"] > .pdf-plus-color-palette-item-inner {\n background-color: #f04242;\n}\n.pdf-plus-color-palette-item[data-highlight-color=\"agree\"] > .pdf-plus-color-palette-item-inner {\n background-color: #2ebf2b;\n}\n.pdf-plus-color-palette-item:not([data-highlight-color]) > .pdf-plus-color-palette-item-inner {\n background-color: transparent;\n}\n.workspace-leaf.pdf-plus-link-opened.is-highlighted::before {\n\topacity: 0.5;\n}\nbody {\n --pdf-plus-info-rgb: 255, 208, 0\n}\nbody {\n --pdf-plus-method-rgb: 52, 106, 234\n}\nbody {\n --pdf-plus-disagree-rgb: 240, 66, 66\n}\nbody {\n --pdf-plus-agree-rgb: 46, 191, 43\n}\nbody {\n --pdf-plus-default-color-rgb: var(--pdf-plus-info-rgb)\n}\n.pdf-plus-backlink-highlight-layer .pdf-plus-backlink:not(.hovered-highlight) {\n background-color: #ffd000;\n}\n.callout[data-callout=\"pdf\"][data-callout-metadata=\"info\"] {\n\t--callout-color: var(--pdf-plus-info-rgb);\n background-color: rgba(var(--callout-color), var(--pdf-plus-highlight-opacity, 0.2))\n}\n.callout[data-callout=\"pdf\"][data-callout-metadata=\"method\"] {\n\t--callout-color: var(--pdf-plus-method-rgb);\n background-color: rgba(var(--callout-color), var(--pdf-plus-highlight-opacity, 0.2))\n}\n.callout[data-callout=\"pdf\"][data-callout-metadata=\"disagree\"] {\n\t--callout-color: var(--pdf-plus-disagree-rgb);\n background-color: rgba(var(--callout-color), var(--pdf-plus-highlight-opacity, 0.2))\n}\n.callout[data-callout=\"pdf\"][data-callout-metadata=\"agree\"] {\n\t--callout-color: var(--pdf-plus-agree-rgb);\n background-color: rgba(var(--callout-color), var(--pdf-plus-highlight-opacity, 0.2))\n}\n.callout[data-callout=\"pdf\"] {\n\t--callout-color: var(--pdf-plus-default-color-rgb);\n background-color: rgba(var(--callout-color), var(--pdf-plus-highlight-opacity, 0.2))\n}\n.callout[data-callout=\"pdf\"] {\n --callout-icon: lucide-highlighter;\n}" }

Originally posted by @programlich in #44 (comment)

[FR] Assign custom copy formats to single markers

Thank you for the great plugin and your great work on it!

In the PDF++ settings a new setting for markers could be introduced: The highlight markers could be bound to specific custom copy formats. For example I have bound the "copy as quote" format to the blue color. Everytime when I switch the markers in the PDF viewer, the custom copy formats switches automatically to the format that is bound to this marker color. Advantage would be here, that you can switch the custom copy format just by changing the markers color in the PDF viewer. For example when the green marker is selected, all my links will have the "bookmark" custom copy format. And if I select the blue color marker, all my links that I assign with that color will have the "Copy as quote" copy format.

Add custom color palette actions to right click menu

Awsome plugin, great work!

Would it be possible to show the custom color palette actions also in the right click menu, that pops up, when I right click the selected text? Now, only the defualt options pop up so I have to go back and select my custom action in the top menu if I need one of theese.

Bug with copy & auto-paste link command

If I highlight a text passage (copy as quote format) with the marker and then execute the "copy & auto-paste link" command with the hotkey, copy formats like "copy as quote" often result in wrong focusing in the annotation tab. The text input cursor (the blinking cursor while typing) jumps around inside the copied text selection or above.
You can reproduce it by creating several links with the copy as quote format, but every time use the copy & auto-paste command. While creating the links look at the open annotation file in the other tab: It doesn't synchronize with the pasted links. The focus in the annotation tab keeps on the first pasted link, and doesn't move to the bottom of the tab where new links are pasted.

Canvas

Interesting: https://forum.obsidian.md/t/make-a-better-pdf-annotation-in-canvas/61298

Currently, PDF++ does not support Canvas because internal links in canvas files are not indexed by Obsidian.
However, it would be possible to highlight backlinks from the same canvas file that the PDF viewer is embedded in.

We could also add a new option such as "create a card from text selection" in Canvas.

copy embed of selection

Why is it that when I select copy embed of selection, the link after pasting is an embed of the whole PDF?

It should be a bug!
Change the setting to the one shown below and it works fine, before it was {{link}}.
image

Renaming this plugin?

I noticed that the name "PDF++" is very hard to search. The suffix "++" is often just ignored.
Enclosing it with double quotes seems to have no effect.

So it might be nice to consider renaming this plugin.

If you have any ideas about a better alternative name for this plugin, please share them here!

Requirements:

  • Keep it short & simple.
  • PDF++ is not just about annotation. It adds many small QOL improvements to the native viewer. So I don't want to give it a name that suggests only its annotation capability.

[FR] Split right by default

Hi

Thank you for this plugin! It is something that logseq has that I have been missing in obsidian.

But, would it be possible to add a feature so that wikilinks to PDFs (when pressed without any modifier keys) automatically open the PDF in a split view to the left or right? This would help with the muscle memory coming from logseq.

Also, for the option How to open markdown file with ctrl+hover when there is no open markdown file, would it be possible to add the option Split left?

Thank you!

Edit: To add more context, I am aware of modifier keys. What I would like to do is overriding the default opening behavior only for links to PDFs. So that I don't have to press the modifier keys when it comes to links to PDFs.

Mixed Colors when clicking links

When a page link is clicked in the annotation file tab, the text in the PDF tab is focused but highlighted again with the yellow color (the yellow color is only temporary). However, the problem now is that if you have highlighted your text in the PDF with the green color and then click on a page link in the annotation file, the green color mixes with the yellow color, making it difficult to read and not looking good. Therefore, an additional option would be good: that PDF++ does not display any additional highlight when clicking on a page link.

Open annotaion note in sidebar

Would it be possible to add a setting that allows to open the annotation note in the right sidebar when clicking on a highlight, which corresponding note is not opened yet?
Having the annotation notes in the sidebar is very convenient when working on small laptop screens because this way they can be expanded an collapsed quickly.

Hover sync

I don't know why this works when the feature is turned off. Possibly a bug?
image

[FR] Disable left sidebar in embed

When the embed is rendered after opening the left sidebar in the pdf viewer, it also appears in the embed. If the embed is trimmed, the option to turn off the left bar is not accessible. Is it possible to add a feature to never show left sidebar in the embed?

resim

Better page label support

  • Set the PageLabels entry of the document catalog
  • Take care of page labels number dictionary updates when adding/inserting/removing/merging/extracting pages

Visualizing `&offset=...` backlinks in PDF viewer like sticky notes

Currently, PDF++ can generate a markdown list consisting of links to each outline item (i.e. beginning of each section or chapter) with the command "Copy PDF outline as markdown list", like so

- [[file.pdf#page=1&offset=...]]
    - [[file.pdf#page=2&offset=...]]
    - [[file.pdf#page=3&offset=...]]
- [[file.pdf#page=5&offset=...]]

The problem is that this link is invisible in PDF viewer, unlike a link to text selection or an annotation.
If they were, we would be able to more easily navigate back and forth between a PDF page and the corresponding markdown file.

zotero rectangle annotation

This plugin really amazes me and is my dream plugin! However, I feel very laggy while using it. I have an idea in the labeling of rectangular areas if it can be done by screenshot and can generate links like zotero's. Of course, I'm not familiar with programming, it's just a whim, thank you very much for developing this plugin!

BUG PDF's won't open anymore

After changing some of the Custom color palette actions the PDFs won't open anymore, its just a blank tab.

The developer consoles displays:
image

Debug Info:

SYSTEM INFO:
Obsidian version: v1.5.6
Installer version: v1.4.13
Operating system: Darwin Kernel Version 23.3.0: Tue Dec 19 20:55:03 PST 2023; root:xnu-10002.80.20.505.4~2/RELEASE_ARM64_T6000 23.3.0
Login status: logged in
Catalyst license: vip
Insider build toggle: on
Live preview: on
Base theme: dark
Community theme: Minimal v7.4.7
Snippets enabled: 10
Restricted mode: off
Plugins installed: 66
Plugins enabled: 61
1: Advanced URI v1.40.0
2: Breadcrumbs v3.6.11
3: Better File Link v1.1.4
4: File path to URI v1.4.1
5: BRAT v0.8.4
6: Vault Statistics v0.1.3
7: Zoom v1.1.2
8: Various Complements v9.3.0
9: Dataview v0.5.64
10: Find orphaned files and broken links v1.9.1
11: Workspaces Plus v0.3.3
12: Another Quick Switcher v11.0.0
13: Automatic Table Of Contents v1.3.2
14: Canvas Style Menu v0.0.6
15: Creases v0.7.0
16: Copy Image and URL context menu v1.5.2
17: Copy Block Link v1.0.4
18: Convert url to preview (iframe) v0.5.0
19: Commander v0.5.1
20: Carry-Forward v1.4.5
21: Image Converter v1.1.7
22: Image Captions v1.1.0
23: Hover Editor v0.11.17
24: Hotkeys++ v0.2.7
25: Footnote Shortcut v0.1.3
26: Hotkey Helper v0.3.18
27: Heading Shifter v1.5.1
28: Get Info v1.1.0
29: Front Matter Title v3.8.4
30: Omnisearch v1.21.1
31: Obsidian better Internal Link Inserter v1.0.0
32: Minimal Theme Settings v7.3.1
33: Metadata Menu v0.8.2
34: Media Extended v3.0.1-beta.1
35: Linter v1.22.0
36: Leaflet v6.0.2
37: Latex Suite v1.9.0
38: Keyboard Analyzer v0.1.3
39: Image Toolkit v1.4.1
40: Quiet Outline v0.3.24
41: PodNotes v2.10.8
42: Persistent Links v0.2.0
43: Periodic Notes v0.0.17
44: Paste URL into selection v1.7.0
45: Paste image rename v1.6.1
46: Pane Relief v0.5.2
47: Outliner v4.8.0
48: Open files with commands v1.2.3
49: Style Settings v1.0.7
50: Tab Switcher v1.4.0
51: Sort & Permute lines v0.7.0
52: Strange New Worlds (SNW) v1.2.5
53: Size History v1.0.0
54: Short links v1.1.5
55: Settings Search v1.3.10
56: Regex Find/Replace v1.2.0
57: Readwise Official v2.0.1
58: Quiz Generator v1.1.0
59: Templater v2.2.1
60: Better Search Views v0.2.2
61: PDF++ v0.35.16

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.

{
"settings": {
"displayTextFormats": [
{
"name": "Obsidian default",
"template": "{{file.basename}}, page {{page}}"
},
{
"name": "Title & page",
"template": "{{file.basename}}, p.{{pageLabel}}"
},
{
"name": "Page only",
"template": "p.{{pageLabel}}"
},
{
"name": "Text",
"template": "{{text}}"
}
],
"defaultDisplayTextFormatIndex": 0,
"syncDisplayTextFormat": true,
"syncDefaultDisplayTextFormat": false,
"copyCommands": [
{
"name": "Callout",
"template": "- {{text}}\n- [!{{calloutType}}|{{colorName}}] {{linkWithDisplay}}\n\n"
},
{
"name": "Quote in callout",
"template": "> [!{{calloutType}}|{{colorName}}] {{linkWithDisplay}}\n> > {{text}}\n> \n> "
},
{
"name": "Custom ",
"template": "- {{text}}\n - {{linkWithDisplay}}\n"
}
],
"useAnotherCopyTemplateWhenNoSelection": false,
"copyTemplateWhenNoSelection": "{{linkToPageWithDisplay}}",
"trimSelectionEmbed": true,
"embedMargin": 50,
"noSidebarInEmbed": true,
"noSpreadModeInEmbed": true,
"embedUnscrollable": false,
"singleTabForSinglePDF": true,
"highlightExistingTab": false,
"existingTabHighlightOpacity": 0.5,
"existingTabHighlightDuration": 0.75,
"paneTypeForFirstPDFLeaf": "",
"openLinkNextToExistingPDFTab": true,
"openPDFWithDefaultApp": false,
"openPDFWithDefaultAppAndObsidian": true,
"focusObsidianAfterOpenPDFWithDefaultApp": true,
"syncWithDefaultApp": false,
"dontActivateAfterOpenPDF": true,
"dontActivateAfterOpenMD": true,
"highlightDuration": 0.75,
"noTextHighlightsInEmbed": false,
"noAnnotationHighlightsInEmbed": true,
"persistentTextHighlightsInEmbed": true,
"persistentAnnotationHighlightsInEmbed": false,
"highlightBacklinks": true,
"dblclickEmbedToOpenLink": true,
"highlightBacklinksPane": true,
"highlightOnHoverBacklinkPane": true,
"backlinkHoverColor": "",
"colors": {
"Yellow": "#ffd000",
"Red": "#EA5252",
"Note": "#086ddd",
"Important": "#bb61e5"
},
"defaultColor": "",
"defaultColorPaletteItemIndex": 0,
"syncColorPaletteItem": true,
"syncDefaultColorPaletteItem": false,
"colorPaletteInToolbar": true,
"noColorButtonInColorPalette": true,
"colorPaletteInEmbedToolbar": false,
"showStatusInToolbar": true,
"highlightColorSpecifiedOnly": false,
"doubleClickHighlightToOpenBacklink": true,
"hoverHighlightAction": "preview",
"paneTypeForFirstMDLeaf": "right",
"singleMDLeafInSidebar": true,
"alwaysUseSidebar": true,
"defaultColorPaletteActionIndex": -1,
"syncColorPaletteAction": true,
"syncDefaultColorPaletteAction": false,
"proxyMDProperty": "PDF",
"hoverPDFLinkToOpen": false,
"ignoreHeightParamInPopoverPreview": true,
"filterBacklinksByPageDefault": true,
"enableHoverPDFInternalLink": true,
"recordPDFInternalLinkHistory": true,
"alwaysRecordHistory": true,
"renderMarkdownInStickyNote": true,
"enalbeWriteHighlightToFile": false,
"author": "",
"writeHighlightToFileOpacity": 0.2,
"defaultWriteFileToggle": false,
"syncWriteFileToggle": true,
"syncDefaultWriteFileToggle": false,
"enableAnnotationDeletion": true,
"warnEveryAnnotationDelete": false,
"warnBacklinkedAnnotationDelete": true,
"enableAnnotationContentEdit": true,
"enableEditEncryptedPDF": false,
"pdfLinkColor": "#04a802",
"pdfLinkBorder": false,
"replaceContextMenu": true,
"executeBuiltinCommandForOutline": true,
"executeBuiltinCommandForZoom": true,
"executeFontSizeAdjusterCommand": true,
"closeSidebarWithShowCommandIfExist": true,
"outlineDrag": true,
"outlineContextMenu": true,
"outlineLinkDisplayTextFormat": "{{file.basename}}, {{text}}",
"outlineLinkCopyFormat": "{{linkWithDisplay}}",
"recordHistoryOnOutlineClick": true,
"popoverPreviewOnOutlineHover": true,
"thumbnailDrag": true,
"thumbnailContextMenu": true,
"thumbnailLinkDisplayTextFormat": "{{file.basename}}, page {{pageLabel}}",
"thumbnailLinkCopyFormat": "{{linkWithDisplay}}",
"recordHistoryOnThumbnailClick": true,
"popoverPreviewOnThumbnailHover": true,
"annotationPopupDrag": true,
"useCallout": true,
"calloutType": "PDF",
"calloutIcon": "highlighter",
"highlightBacklinksInEmbed": false,
"highlightBacklinksInHoverPopover": false,
"highlightBacklinksInCanvas": true,
"clickPDFInternalLinkWithModifierKey": true,
"clickOutlineItemWithModifierKey": true,
"clickThumbnailWithModifierKey": true,
"focusEditorAfterAutoPaste": true,
"autoFocus": false,
"autoFocusTarget": "last-active-and-open-then-last-paste",
"autoPasteTarget": "last-active-and-open-then-last-paste",
"openAutoFocusTargetIfNotOpened": true,
"howToOpenAutoFocusTargetIfNotOpened": "right",
"closeHoverEditorWhenLostFocus": true,
"closeSidebarWhenLostFocus": true,
"openAutoFocusTargetInEditingView": true,
"executeCommandWhenTargetNotIdentified": true,
"commandToExecuteWhenTargetNotIdentified": "switcher:open",
"selectToCopyToggleRibbonIcon": true,
"autoFocusToggleRibbonIcon": true,
"viewSyncFollowPageNumber": true,
"viewSyncPageDebounceInterval": 0.3,
"openAfterExtractPages": true,
"howToOpenExtractedPDF": "tab",
"warnEveryPageDelete": false,
"warnBacklinkedPageDelete": true,
"extractPageInPlace": false,
"askExtractPageInPlace": true,
"pageLabelUpdateWhenInsertPage": "keep",
"pageLabelUpdateWhenDeletePage": "keep",
"pageLabelUpdateWhenExtractPage": "keep",
"askPageLabelUpdateWhenInsertPage": true,
"askPageLabelUpdateWhenDeletePage": true,
"askPageLabelUpdateWhenExtractPage": true,
"copyOutlineAsListFormat": "{{linkWithDisplay}}",
"copyOutlineAsListDisplayTextFormat": "{{text}}",
"copyOutlineAsHeadingsFormat": "{{text}}\n\n{{linkWithDisplay}}",
"copyOutlineAsHeadingsDisplayTextFormat": "p.{{pageLabel}}",
"copyOutlineAsHeadingsMinLevel": 2,
"newFileNameFormat": "",
"newFileTemplatePath": "",
"pageLabelUpdateWhenDividePDFs": "keep",
"askPageLabelUpdateWhenDividePDFs": true
},
"styleSheet": ".pdf-plus-backlink-highlight-layer .pdf-plus-backlink:not(.hovered-highlight)[data-highlight-color="yellow"],\n.pdf-embed[data-highlight-color="yellow"] .textLayer .mod-focused {\n background-color: #ffd000;\n}\n.pdf-plus-backlink-highlight-layer .pdf-plus-backlink:not(.hovered-highlight)[data-highlight-color="red"],\n.pdf-embed[data-highlight-color="red"] .textLayer .mod-focused {\n background-color: #EA5252;\n}\n.pdf-plus-backlink-highlight-layer .pdf-plus-backlink:not(.hovered-highlight)[data-highlight-color="note"],\n.pdf-embed[data-highlight-color="note"] .textLayer .mod-focused {\n background-color: #086ddd;\n}\n.pdf-plus-backlink-highlight-layer .pdf-plus-backlink:not(.hovered-highlight)[data-highlight-color="important"],\n.pdf-embed[data-highlight-color="important"] .textLayer .mod-focused {\n background-color: #bb61e5;\n}\n.pdf-plus-backlink-highlight-layer .pdf-plus-backlink:not(.hovered-highlight) {\n background-color: rgb(var(--text-highlight-bg-rgb));\n}\n.pdf-plus-backlink-highlight-layer .pdf-plus-backlink.hovered-highlight {\n\tbackground-color: green;\n}\n.pdf-plus-color-palette-item[data-highlight-color="yellow"] > .pdf-plus-color-palette-item-inner {\n background-color: #ffd000;\n}\n.pdf-plus-color-palette-item[data-highlight-color="red"] > .pdf-plus-color-palette-item-inner {\n background-color: #EA5252;\n}\n.pdf-plus-color-palette-item[data-highlight-color="note"] > .pdf-plus-color-palette-item-inner {\n background-color: #086ddd;\n}\n.pdf-plus-color-palette-item[data-highlight-color="important"] > .pdf-plus-color-palette-item-inner {\n background-color: #bb61e5;\n}\n.pdf-plus-color-palette-item:not([data-highlight-color]) > .pdf-plus-color-palette-item-inner {\n background-color: transparent;\n}\n.workspace-leaf.pdf-plus-link-opened.is-highlighted::before {\n\topacity: 0.5;\n}\nbody {\n --pdf-plus-yellow-rgb: 255, 208, 0\n}\nbody {\n --pdf-plus-red-rgb: 234, 82, 82\n}\nbody {\n --pdf-plus-note-rgb: 8, 109, 221\n}\nbody {\n --pdf-plus-important-rgb: 187, 97, 229\n}\nbody {\n --pdf-plus-default-color-rgb: var(--text-highlight-bg-rgb)\n}\n.pdf-plus-backlink-highlight-layer .pdf-plus-backlink:not(.hovered-highlight) {\n background-color: rgb(var(--text-highlight-bg-rgb));\n}\n.callout[data-callout="pdf"][data-callout-metadata="yellow"] {\n\t--callout-color: var(--pdf-plus-yellow-rgb);\n background-color: rgba(var(--callout-color), var(--pdf-plus-highlight-opacity, 0.2))\n}\n.callout[data-callout="pdf"][data-callout-metadata="red"] {\n\t--callout-color: var(--pdf-plus-red-rgb);\n background-color: rgba(var(--callout-color), var(--pdf-plus-highlight-opacity, 0.2))\n}\n.callout[data-callout="pdf"][data-callout-metadata="note"] {\n\t--callout-color: var(--pdf-plus-note-rgb);\n background-color: rgba(var(--callout-color), var(--pdf-plus-highlight-opacity, 0.2))\n}\n.callout[data-callout="pdf"][data-callout-metadata="important"] {\n\t--callout-color: var(--pdf-plus-important-rgb);\n background-color: rgba(var(--callout-color), var(--pdf-plus-highlight-opacity, 0.2))\n}\n.callout[data-callout="pdf"] {\n\t--callout-color: var(--pdf-plus-default-color-rgb);\n background-color: rgba(var(--callout-color), var(--pdf-plus-highlight-opacity, 0.2))\n}\n.callout[data-callout="pdf"] {\n --callout-icon: lucide-highlighter;\n}"
}

Color palette customization options

PDF++ adds some controllers like color icons and dropdowns in PDF toolbars, but the current one is not very easy to use.
For example, I often want easier access to the copy format menu than the color selector.

So it would be a nice idea to allow several choices of the UI.


Redefine a color palette (or a PDF++ toolbar component) as anything that satisfies the following:

  • It has a state represented by
    interface ColorPaletteState {
        colorName: string | null; // or colorIndex: number
        actionIndex: number; // index of a custom copy format (or color palette action)
        displayTextFormatIndex: number;
        writeFile: boolean;
        selectToCopy: boolean;
        autoPaste: boolean;
    }
  • It supports getState(): ColorPaletteState; and setState(state: ColorPaletteState): void;

Provide several classes that implement the above requirements, and leave the choice to the user.


Unfortunately, I don't have great experience in UI coding so I will welcome PRs adding new UI choices or improving the existing one.

[BUG] Cannot use display text format

When I use {{file.basename}}, {{page}}/{{pageCount}}, "{{selection}}" or {{file.basename}} as Display text format, I get the following errors

resim

resim

[FR] Automatic pasting into note after copying

This feature would be amazing: If a text is highlighted with a marker, the text will be automatically inserted in the corresponding annotation note file. This corresponding annotation file is glued to the PDF file. So when opening the PDF, the note with the glued annotations will open as well in an adjacent pane.

Callouts with highlight color

Is there a way for passing the selected hightlight color to the callout which is created when pasting the selection to my annotation note? That way the colors would match in the pdf and the annotation note and it would be easier for me to get them visually in line. It would be great to have the automatically colored callouts because when highlighting, the colors have distinct meanings for me and it would make reading my annotation note even more convenient to have this logic also applied in the callouts.

Right now I already love the view of callouts holding the annotations and my thoughts. It is very similar to the zotero view and would become even better with the automatic coloring functionality.

[Disscussion] better context view in backlink panel?

When we make an annotation in Zotero's PDF viewer, we can comment on that annotation directly in the comment card (the comment in the left panel, not the entry comment in the right panel).

By using this plugin, we could distribute the annotation throughout the vault, and we might also take some comments around that annotation.

since this plugin could display the backlink for a specific pdf page, is it possible to display more context when triggering the context button in the backlink panel (for now this button doesn't affect anything), like the behaviour in the markdown file?

Currently I use three monitors, there is no such requirement for this feature actually, I could just display multiple windows at the same time, one for pdf, one for markdown.
It is also a quality of life improvement, I just wonder if there is a way to make the backlink view better, more like zotero or zotlit's annotation view.

Double click > Jump to Annotation

If you double-click on a highlighted area in the PDF, it jumps to the correct location in the annotations file. However, the problem is that the tab with the note file does not get focused. Because the tab with the note file is not focused, you cannot immediately edit or delete the annotation. It would be better if, upon double-clicking on a highlight in the PDF, the note file in the other tab is focused so that you can edit or delete the annotation right away.

[FR] Icons for custom copy formats

Selecting a text with the marker > right click > add bookmark. When "add bookmark" is clicked from this context menu, it creates a special page link in the annotation file. Maybe this link is then named "Bookmark:" And after this word "Bookmark:" the user can name this bookmark, for example "Bookmark: Chapter 3".

[FR] Changing page layout in embed

If the page layout is set to double page in the pdf viewer, it also shows double page in the embed, which makes it very difficult to read. Is it possible to set a page layout in the embed that is independent of the main pdf viewer?

resim

[FR] Hightlight content without copy text

Hi, thanks for you effort into this wonderful pulgin!
And a little polishment will definitely make it better.
I find that "hightlight" is only applicable when I copy the text into my note
but sometimes i just want to hightlight without citing or copying content into my note.

[FR] An option for setting sidebar width

it's very disturbing to resize the sidebar whenever open a new PDF file, i found a way to automatically adjust the width of the sidebar

.pdf-content-container.node-insert-event.sidebarOpen {
    --sidebar-width: 330px;
}

we could provide a setting option to set the width, this may help others who suffering the same pain

[FR] Extract Highlights

First of all thanks!!
I never really used PDF in obsmd, but it's now changing and that in part of PDF++.
I just scrolled trough the settings and it's crazy how big this is. Props!

One thing I would find really useful, is to extract all highlights of a PDF and be able to paste them in a .md file, with the backlinks to the pdf.
I think it's something a lot of people could find helpful. :)

[FR]Improved behavior of opening notes from pdf citation section

設定によると,command+hover によって,PDFから引用部分のnoteが開かれる筈ですが,hover editor プラグインを使っていくと,hover 画面が出て,tab や new window では開かれません。
これは,キーがバッティングしているだと思いますが,そこで,この設定を,command+hover 以外にして欲しいです(ctr+hoverなど)。
また,ダブルクリックすると,新しいタブで必ず開かれますが,そうすると並べて見られないので,これも設定で変更できるようにして欲しいです。

よろしくご検討ください。

pdf.mov

handwriting

annotation with handwriting in pdf and pen support

[FR] resizable selection area?

hi, I just wonder if there any possible to update the selection area, after initially pasting the quote to the markdown file

it's two separate problems actually

  • update the backlink
  • update the quoted text with newly selected

I've noticed that the link to the annotation contains the selection area, like below

#page=60&selection=100,8,102,65

simply envision this, implementing the resize may depend too much on obsidian internals, and may take too much effort.

since now you can manage backlinks, just updating the backlinks may be more approachable. if we could update the selection query params in links, we can somehow emulate such resize behavior

the second problem may not be so easy, and if we use embedded with margin, maybe it is not necessary to implement this. but I am somehow concerned about the performance if you embed too many PDF viewer instances in tabs, especially when you open dozens of tabs.

the way how logseq implements this feature may give an inspiration. it establishes an external identifier manager, in which the annotation and the quoted are both linked to that identifier, once the annotation changes, the corresponding quoted text will also get updated. but this will also need too much effort.

by the way, is there any other way I could sponsor you? Neither GitHub sponsor nor buymeacoffee support PayPal, while I don't have any bank card which I can use directly on these websites

[FR] open pdf in obsidian from zotero

if we directly set obsidian as the default app for PDF, when we open the PDF, we will redirected to the vault select panel in fact,

I found a way to use the URI scheme, but this needs extra setup

I create a Python file and packaged it as a .exe file, which simply transfers the open/start CLI command trigger by Zotero, to an obsidian open file scheme

file_path = sys.argv[1]

# url encode
url_file_path = urllib.parse.quote(file_path)

# open by URL scheme
os.system(f"start obsidian://open?path={url_file_path}")

I just wonder if there is any better method to accomplish this behavior, since now with this plugin, we could use obsidian as the viewer and annotator, but we still need the capability Zotero provided to manage literature.

Record progress & share it across devices

I was wondering whether you would consider storing the reading progress of each file that is viewed, rather than storing the progress of only the current file viewed?

Currently, I rely on Omnivore for reading longer pdfs from beginning to end, because Obsidian tends to lose track of my reading progress when I'm reading across several sessions and/or devices. With this plugin recording the reading progress of each pdf, Obsidian may be able to replace this functionality of Omnivore.

Originally posted by @callumalpass in RyotaUshio/obsidian-view-sync#1 (comment)


That would be a nice feature to have. It would be better handled by PDF++ rather than this plugin, though.
What I have in mind for now is:

  1. Each device records the latest progress (page, zoom level etc) and a timestamp in its own dedicated file like pdf-progress-macbook.json.
  2. When opening a PDF file, PDF++ looks up the latest progress in the file, then sets the page number and so on accordingly.

This way, we will be able to record progress in each device. In addition, we could add an option like "share progress across devices" and specify which file to read another device's progress from (e.g. pdf-progress-ipad.json).

If this option is enabled, PDF++ compares the timestamps from all the devices and follows the latest one.

[FR] Sorting Annotations by Page Number

I don't know if it's possible, but this function would be awesome: When executed, the annotations in the markdown file will be sorted by page number. This would be helpful if the annotations are mixed up from different chapters on different pages, and you are using only one annotation markdown file.

Small bug

When a link is copied and pasted into a note, the link to the PDF (the clickable link with title+page for example) is only visible if "wiki-links" is enabled in the obsidian settings.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.