Opened 13 years ago
Last modified 12 years ago
#10004 new enhancement
support of pdf file ressource path for Apache location
Reported by: | falkb | Owned by: | ursaw |
---|---|---|---|
Priority: | high | Component: | PdfImagePlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 0.11 |
Description
Since my Apache webserver 192.168.1.10
also offers a location /Foo
(which is a mapping to another network resource), I can access pdf files in the browser by typing https://192.168.1.10/Foo/example.pdf
in the address line of the browser. Also [//Foo/example.pdf My PDF file]
works as Trac link.
Now I want to use this path for PdfImg
[[PdfImg(//Foo/example.pdf)]]
but it just gives me the following error:
Error: Macro PdfImg(//Foo/example.pdf) failed Der Anhang 'wiki:WikiStart: //Foo/example.pdf' existiert nicht.
Attachments (0)
Change History (5)
comment:1 Changed 13 years ago by
comment:2 follow-up: 3 Changed 13 years ago by
I set
file.preurl = https://192.168.1.10
and tried
[[PdfImg(file:/the/rest/of/the/url/path/myfile%20test.pdf)]]
but get
Error: Macro PdfImg(/the/rest/of/the/url/path/myfile%20test.pdf) failed asciifile:/the/rest/of/the/url/path/myfile%20test.pdf6162ordinal not in range(128)
I also don't understand why I must cut the whole thing into 3 pieces (prepath, preurl, path in macro)... Seems, it is important to know about the internals to get it where to cut my path into 3 pieces...
comment:3 follow-ups: 4 5 Changed 13 years ago by
Replying to falkb:
PdfImg(file:/the/rest/of/the/url/path/myfile%20test.pdf)? }}} but get
Error: Macro PdfImg(/the/rest/of/the/url/path/myfile%20test.pdf) failed asciifile:/the/rest/of/the/url/path/myfile%20test.pdf6162ordinal not in range(128)
This is an interesting case: Your file "myfile%20test.pdf" contains a blank "%20" apache resolves this correct, but if convert try to use "%20" on the filesystem this is not the same than a blank!
Please try a filename without a blank, or try
PdfImg(/the/rest/of/the/url/path/myfile test.pdf)
The Internals
This plugin an trac itself always distinguish between the external path and the internal path.
The mapping for the internal path in for tickets is implicit by the location of the tracenvironment on the harddrive and the external is done by the keyword "ticket:". If you have a look to Subversion-Resources, the external is "browser:" or "source:" and you find the internal in the trac configuration like:
[trac] repository_type = svn repository_dir = /path/to/the/svn
Something simular is done with the "file:" Resource. file.prepath
is the internal, which is using convert
, the external, which displays the png is relative to the tracenvironment and file.preurl
is used as a (external) link for the PDF.
comment:4 Changed 12 years ago by
comment:5 Changed 12 years ago by
ursaw, thank you for your reply.
Replying to ursaw:
The mapping for the internal path in for tickets is implicit by the location of the tracenvironment on the harddrive
What is "location of the tracenvironment on the harddrive"? The root path of the Trac system? The path of the Trac user project?
the external, which displays the png is relative to the tracenvironment
How can an external URL be relative to the trac environment? Not understood.
and
file.preurl
is used as a (external) link for the PDF.
If the file is at https://192.168.1.10/Foo/test.pdf
, do I have to set file.preurl = https://192.168.1.10/Foo
and then call [[PdfImg(test.pdf)]]
; or rather file.preurl =
and [[PdfImg(https://192.168.1.10/Foo/test.pdf)]]
?
I think in your case you should try to use the Plugin with the
file:
protocol.You first need to add in the
tracenv/conf/trac.ini
. the mapping to the other network resource with see pdfimg.py parse_file() Line 277I think this would be in your case something like:
the plugin must known the physical location in the fileystem. you must therfore do the mapping a second time in the
tracenv/conf/trac.ini
.