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 #45

Closed
wtetsu opened this issue Aug 10, 2020 · 9 comments
Closed

PDF support #45

wtetsu opened this issue Aug 10, 2020 · 9 comments
Assignees

Comments

@wtetsu
Copy link
Owner

wtetsu commented Aug 10, 2020

Add PDF support

wtetsu added a commit that referenced this issue Aug 10, 2020
@wtetsu
Copy link
Owner Author

wtetsu commented Aug 10, 2020

How it works

pdf_demo

wtetsu added a commit that referenced this issue Aug 11, 2020
@monado3
Copy link

monado3 commented Aug 15, 2020

Thank you for the new feature.
But this has two problems.

Problem 1

The pdf viewer launced by Mouse Dictionary is incomplete.
Some pdf files are not correctly rendered like this pdf
You can see some parts of the pdf are unseen.

chrome default viewer the viewer launched by Mouse Dictionary
original after

Problem 2

On my tool, you could use Mouse dictionary until this update, by hosting pdf files by pdfjs on Docker.
Though, after this update, when you open a pdf file by my tool and then launch Mouse Dictionary, you are forced to launch the new pdf viewer and it cannnot load the pdf file somehow.

This is the screenshot at the moment that the pdf viewer failed to open the pdf viewer.
notwork
(Please see the bottom part of the screenshot)

My wish

For me, I would be very glad if you can turn ON/OFF the new external pdf viewer feature.
Some people would like this update.
But other people like me don't need this feature.

I can write a Japanese version comment, if you wish because my English is too bad to read.
Thank you for reading.

@wtetsu
Copy link
Owner Author

wtetsu commented Aug 15, 2020

@monado3

thank you for your report

Problem 1

Reproduced. Let me check in details later on.

Problem 2

Could you please try changing PDF URL pattern(PDFドキュメントとみなすURLパターン
) in Advanced settings?
To empty this field may make your tool avaiable again.

image

(FYI: The function that determins PDF document or not)
https://github.com/wtetsu/mouse-dictionary/blob/master/src/main/core/start.js#L70

@monado3
Copy link

monado3 commented Aug 15, 2020

Thank you for your prompt response.

Making the field empty solution worked well.
Thank you so much for the information.

Again, thank you for this wonderful tool.

@wtetsu
Copy link
Owner Author

wtetsu commented Aug 15, 2020

By the way, "PDF URL pattern" was an experimantal feature,
but it turned out it could cause problems like your case,
so I decided to improve that.

You don't have to bother to change the settings next time.


Current(1.4.2):

  • default value: \.(?:pdf|PDF)\??[\w-=&~]*$
  • How MD determin PDF document or not
    • Embded PDF document exists -> true
    • ↓false
    • "PDF URL pattern" matches the current URL -> true ※Here was your problem
    • ↓false
    • Others -> false

The default value could cause problem.

Newer version

  • default value: empty
  • How MD determins PDF document or not
    • If "PDF URL pattern" is empty -> Embded PDF document exists -> true
    • If "PDF URL pattern" is NOT empty -> "PDF URL pattern" matched the current URL -> true

The default behavior is safer than before.

wtetsu added a commit that referenced this issue Aug 15, 2020
@wtetsu wtetsu self-assigned this Aug 15, 2020
@wtetsu
Copy link
Owner Author

wtetsu commented Aug 16, 2020

v1.4.3 has been released.

Problem 1: Fixed

Chrome Mouse Dictionary
original after

@kota-may478
Copy link

kota-may478 commented Apr 26, 2022

Thank you for your kind effort in PDF support.
I have one question about whether I can apply this feature to a PDF file uploaded on the Web as a JSP file.

I want to apply this feature to the PDF file uploaded on the below URL (I'm afraid you can't access the URL).
https://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=9291317&tag=1

I have changed the advanced option like the below picture, but it was no effect.
Do you have any comments about this problem?

AdvancedOption

Thank you in advance!

@wtetsu
Copy link
Owner Author

wtetsu commented Apr 26, 2022

Since I cannot access the URL I cannot confirm it. Is the URL reality a single PDF document? If the page is HTML and a PDF document is embedded, Mouse Dictionary doesn't work.

@kota-may478
Copy link

I see! The page is composed of JSP (=HTML+Javascript).
That's why I can't apply this feature to the page.

Thank you for your quick response!

@wtetsu wtetsu closed this as completed Nov 19, 2022
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