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 images and Windows paths #502

Closed
pr-apes opened this issue May 29, 2023 · 5 comments
Closed

PDF images and Windows paths #502

pr-apes opened this issue May 29, 2023 · 5 comments

Comments

@pr-apes
Copy link
Contributor

pr-apes commented May 29, 2023

@pgundlach,

this comes from #500, this XPath function is problematic in Windows:

sd:aspectratio(concat($pdfdoc, ':', $runpage ':mediabox'))

I use drag and drop to a .bat file in Windows, which provides the full path for $pdfdoc.

It took me a while to realize that full paths in Windows include :, such as in c:\Users\name\Desktop\a.pdf.

So the previous XPath function complains about not being able to find image C.

Sorry, but I don't know how to avoid the colon here. Using URI (either file:// or https://) would have the same problem.

Could you take a look at this? (I wonder whether a syntax such as the one described in speedata/xts#10 (comment) would make sense here.)

Many thanks for your help.

@pgundlach
Copy link
Member

Why is life so complicated? :-)

I'll take a look.

@pr-apes
Copy link
Contributor Author

pr-apes commented May 29, 2023

Quick and dirty hack, replace colon with semicolon.

So the problematic function would read:

sd:aspectratio(concat($pdfdoc, ';', $runpage ';mediabox'))

It is a dirty workaround. With literally no time to consider other implications.

Just in case it helps.

@pr-apes
Copy link
Contributor Author

pr-apes commented May 29, 2023

I don't know how many users deploy the colon for image selection.

This would break existing code, of course. Not sure how many people are using this feature.

pgundlach added a commit that referenced this issue Jun 2, 2023
The colon syntax is no good. See #502
@pgundlach
Copy link
Member

The syntax is now as in XTS (filename, optional page number, optional PDF box, optional unit) - no colons anymore.

I'll close this issue and thank you as always for the valuable feedback!

@pr-apes
Copy link
Contributor Author

pr-apes commented Jun 21, 2023

Many thanks for the new implemented syntax.

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

No branches or pull requests

2 participants