Skip to content

MD version import silently drops annotations of linked, non-asset pdfs #923

Closed

Description

@jaker-dotcom

Search first

  • I searched and no similar issues were found

What Happened?

I wanted to do the switch to DB version but I noticed all annotations for my externally linked PDFs were lost during import. I use that feature extensively. On Discord noone seemed to know either.

Reproduce the Bug

Reproduce:

  1. In the md version link a pdf in the filesystem somewhere outside of the assets folder via ![text](file:///path)
  2. highlight and annotate
  3. import to db version in the desktop app (latest nightly)
  4. navigate to the link and open it
  5. click on the annotations page

Results

  • PDF still opens
  • annotations lost (not only the link is broken, the entire page is lost)
  • essentially my entire bachelor's modules notes are gone (highlights, references to it)

Expected Behavior

Expected results

  1. in a first step warn about highlights pages in the asset folder with no matching PDF and don't delete the highlights file!
  2. ultimately actually import the highlights
  3. In the meantime provide guidance as to how to import PDFs with annotations if you used to work on linked files.

Screenshots

No response

Files

No response

Browser, Desktop or Mobile Platform Information

No response

Additional Context

Already tried:

  1. Copying over the old highlights page to the asset folder via the file explorer does not seem to work (db version probably does not use these files anymore).
  2. Copying over the content from Logseq md does not preserve highlight position etc, just the content.

Further ideas:

  1. turn each pdf into an internal one before importing to db. IIRC that works but I don't know of any means to do this automatically for so many files.

Question:

  • When clicking on annotations page of these PDFs it asks to create "a local one". When I do that a new entity shows up in #Assets and on my journal, but no PDF actually appears in my asset folder. So is this "local asset" merely a reference to the external PDF still?

Are you willing to submit a PR? If you know how to fix the bug.

  • I'm willing to submit a PR (Thank you!)

Activity

  1. changed the title [-]PDF import silently drops annotations of linked, non-asset pdfs[/-] [+]MD version import silently drops annotations of linked, non-asset pdfs[/+] on Jun 7, 2026
  2. juffyyyy commented on Aug 15, 2026

    @juffyyyy

    Hello !

    I have a similar issue. Sometimes the highlights are imported, but the annotations (what i write in the same page as the highlights) are deleted.

  3. megayu commented on Aug 17, 2026

    @megayu

    @juffyyyy Which version are you running? It should be fix after logseq/logseq#12815 merged

  4. jaker-dotcom commented on Aug 20, 2026

    @jaker-dotcom
    Author

    Thanks @ everyone involved! I wonder why the issue wasn't closed. Is that up to me? I may need some time for testing the migration again...

  5. ccyang2019 commented on Aug 29, 2026

    @ccyang2019

    I got the similar issue with the latest build. below is the bug report summarized by gemini.

    Bug Report: PDF Annotation Import Issues with External Local Paths and Remote URLs

    Environment

    • App Versions: Desktop Nightly Release 20260826 and Desktop App v2.0.1 (Beta Testing)
    • OS: Windows

    Summary
    When importing an existing Markdown graph into the DB version, PDF annotations and asset path resolution fail in two specific external PDF scenarios:

    • External Local PDFs (file://): Highlights and area crops import, but the generated Asset entity has an unescaped/malformed URI path that prevents the PDF from opening.
    • External Remote PDFs (https://): Block references pointing to highlights (((UUID))) fail to resolve and render as blank/empty blocks after migration.

    Issue 1: External Local PDF generates invalid Asset URI path

    • Source Markdown format:

      ![local_pdf](file:///D:/assets/xxx.pdf)

    *Observed Behavior:

    • Highlight text and area crops import into the database.
    • However, clicking to open the PDF fails because the generated Asset entity assigns an invalid path:
      • Current Imported Path: External URL: file://D:\assets\xxx.pdf (mixed forward/backward slashes and unescaped drive colon).
    • Manual Workaround: Changing the asset URI schema to the internal format allows it to open correctly:
      • Working Path: assets:///D/logseq__colon/assets/xxx.pdf

    *** Expected Behavior:**

    • The migration importer should automatically normalize Windows file:/// paths into the valid internal asset URI format (assets:///.../logseq__colon/...).

    Issue 2: External Remote URL PDFs silently drop highlight block references

    • Source Markdown format:
      ![remote_pdf](https://teams.apple.inc/sites/url.pdf)

    *** Observed Behavior:**

    • Notes containing block references to highlights from this remote PDF (e.g., ((6a9157a6-804a-41e4-81e3-87f6d9881127))) fail to import the underlying reference data.
    • The block reference resolves to nothing/blank in the imported database.

    *** Expected Behavior:**

    • The DB importer should recognize hls__*.md annotation files associated with remote https:// URLs, register the remote PDF as an Asset entity, and preserve all linked block highlight references (((UUID))).

    Steps to Reproduce

    • In Logseq Markdown, create two notes:
      • Note A: Link a local PDF outside the graph root via ![doc](file:///D:/assets/test.pdf) and highlight text/regions.
      • Note B: Link a remote PDF via ![web_doc](https://example.com/spec.pdf) and highlight text.
    • Reference both highlights in a journal page using ((UUID)).
    • Import the Markdown graph into Logseq DB (v2.0.1 Beta / Nightly 20260826).
    • Attempt to open the local PDF from the Asset page \rightarrow path resolution error occurs.
    • Inspect the journal page \rightarrow the remote PDF block reference ((UUID)) is empty.
  6. tiensonqin commented on Aug 31, 2026

    @tiensonqin
    Contributor

    Closing as fixed by logseq/logseq#12815.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions