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 时支持将资源文件作为附件嵌入 #7414

Closed
vagaruy opened this issue Feb 20, 2023 · 13 comments
Closed

导出 PDF 时支持将资源文件作为附件嵌入 #7414

vagaruy opened this issue Feb 20, 2023 · 13 comments
Assignees
Milestone

Comments

@vagaruy
Copy link

vagaruy commented Feb 20, 2023

在什么情况下你需要该特性?In what scenarios do you need this feature?

I work as a software engineer and write a lot of root cause analysis reports. I use siyuan to manage my analysis and it contains a lot of log files and other binary resources.

Currently when I export a pdf , these assets are exported in a separate directory but it makes it very hard to distribute the files.

描述可能的最优解决方案 Describe the optimal solution

It would be great if the PDF export had an option to embed the local assets in the PDF file itself instead of exporting them in a separate directory. It can appear as a icon inside the pdf itself that anyone can open it if needed.

描述候选的解决方案 Describe the candidate solution

  1. Add option during Export PDF to specify the following
    Embed Assets (Yes/No)
  2. Generated pdf has the assets embedded inside.

其他信息 Other information

No response

@88250 88250 changed the title Embedding assets in the exported PDF 导出 PDF 时支持将资源文件作为附件嵌入 Feb 20, 2023
@88250 88250 added this to the backlog milestone Feb 20, 2023
@88250
Copy link
Member

88250 commented Feb 20, 2023

Hello, this is a good idea.

I just did some experimentation and found a solution to add assets as attachments to the PDF, but I can't hyperlink the original asset to the attachment.

image

@vagaruy
Copy link
Author

vagaruy commented Feb 20, 2023

Even in the current implementation with external assets, the links don't resolve correctly with the http://127.0.0.1/.. link in there. It probably need to be changed regardless.

@88250
Copy link
Member

88250 commented Feb 21, 2023

You're right, but currently we haven't figured out how to point a hyperlink in a PDF to a local file.

@vagaruy
Copy link
Author

vagaruy commented Feb 21, 2023

For the external assets at least, I tested with a different pdf generator and the following links resolve correctly file:///home/vagaruy/Desktop/assets/test_file . I haven't been able to test with embedded attachments yet however.

@88250
Copy link
Member

88250 commented Feb 21, 2023

Can you help to test whether a relative path can be generated?

@88250
Copy link
Member

88250 commented Feb 22, 2023

After some exploration, we have found a technical solution to change the asset of the http://127.0.0.1 server to a local relative path and link it to the assets folder.

For example, when placing pdf and assets on the desktop:

image

When we move the pdf and its assets, the relative path still works fine:

image

@88250
Copy link
Member

88250 commented Feb 22, 2023

Finally, we found a way to jump to embedded attachments, and unified improvement in this issue, thank you.

@vagaruy
Copy link
Author

vagaruy commented Feb 22, 2023

thank you for the great work on this.

@88250
Copy link
Member

88250 commented Feb 22, 2023

image

The previous hyperlink cannot be clicked, you need to double-click the attachment annotation to open the attachment.

@vagaruy
Copy link
Author

vagaruy commented Feb 23, 2023

I tested the pre-release siyuan-v202302231520-linux.AppImagewith the fix but there seems to be some problem with the embedding. The links still point to http:// and the files are not embedded either.
Attached a screenshot of the incorrect link.
cropped_image

@88250 88250 reopened this Feb 24, 2023
@88250
Copy link
Member

88250 commented Feb 24, 2023

Thanks for testing, we will fix it later.

@vagaruy
Copy link
Author

vagaruy commented Sep 4, 2023

Hello . I recently tried testing this on 2.10.2 and the embedding asset don't seem to be working anymore.

@88250
Copy link
Member

88250 commented Sep 4, 2023

@vagaruy It will be fixed in the next version, thanks for the feedback.

REF: #9106

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

No branches or pull requests

3 participants