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

PDF Support on published graphs #19

Open
daviddavo opened this issue Dec 11, 2023 · 2 comments
Open

PDF Support on published graphs #19

daviddavo opened this issue Dec 11, 2023 · 2 comments
Labels
duplicate This issue or pull request already exists

Comments

@daviddavo
Copy link

Currently, published graphs that link a PDF don't work. Not only you can't use the built-in logseq viewer, you can't even download the PDF (without editing the URL or using your browser's developer tools). It's as if the link is broken.

An easy meantime patch could be just linking the PDF so it works in the browser or it downloads the file, even if highlighting and notes don't work.

As @LuciferianInk said:

I understand that in-page PDF highlighting and such may be difficult to support in the exported web app, currently, but it would be VERY nice if there was still a link, for my users to click. As it is, the PDF link is simply stripped from the export, leaving a bunch of pages where PDF content is referenced, but there's no actual PDF to look at.

To Reproduce

Steps to reproduce the behavior (from original post logseq/logseq#4048):

  1. Add a PDF to your logseq graph
  2. Export the graph as standalone HTML
  3. Open the standalone HTML
  4. Try opening the PDF

Workaround

From @acsr post

Manually change the Link in the Markdown source of the page into a file asset:
Remove the leading ! and replace the two dots starting the go-one-up asset link with a same level file link prefix
[Filename-of-the-pdf-as-text.pdf](file://./assets/Filename-of-the-pdf-as-text.pdf)

  • For me the PDF now shows up in a new tab using the default PDF viewer of the browser (for me: inside a new Chrome tab), when the PDF is already in the assets folder. But it is not exported there automatically anymore!

Solution to finalize the workaround

  • Do not remove the default PDF asset ![Name.pdf](../assets/Name.pdf) Link in the MD
  • Add an aditional Display link [Name.pdf](file://./assets/Name.pdf) just after the regular PDF asset link
    This exports the PDF into assets, works as usual in the Logseq app but adds at least link access to the asset!

Poor but better than nothing.

Note

This is a duplicate of logseq/logseq#4048

@acsr
Copy link

acsr commented Dec 11, 2023

I tested the export in publish-spa (with a 0.9.18 static build) with same issue and my workaround doing the basic job.

publish-spa main was hopefully updated to 0.3.0 by pulling main and running just yarn install, but logs no changes.
Need to lookup if updating needs another command. (updating procedure is not mentioned in the README.md yet)

Now I want to update the static build to 0.10.x first and then investigate publish-spa deeper.

@logseq-cldwalker logseq-cldwalker added the duplicate This issue or pull request already exists label Jan 9, 2024
@filiptrplan
Copy link

filiptrplan commented Feb 6, 2024

Is there any update on this? Would be great to have PDFs linked in the published page.

Is the team at least considering this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

4 participants