speedata / publisher

speedata Publisher - a professional database Publishing system

Home Page:https://www.speedata.de/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PDF images and Windows paths

pr-apes opened this issue · comments

@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.

Why is life so complicated? :-)

I'll take a look.

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.

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.

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!

Many thanks for the new implemented syntax.