Forum How do I...?

can't find png image

sambodhiprem
Prince can't find an png image (hr-cloud.png) even though it is in the same folder as before (the img folder):

cpe-124-181-130-216:~ sambodhiprem$ prince /Volumes/Silent\ Sky/Dropbox/Websites/MyWayTheWayOfTheWhiteClouds/White-Cloud-book/chapter01.html 
prince: /Volumes/Silent Sky/Dropbox/Websites/MyWayTheWayOfTheWhiteClouds/White-Cloud-book/css/mywaythewayofthewhiteclouds.css: warning: failed to parse all CSS rules
prince: /Volumes/Silent Sky/Dropbox/Websites/MyWayTheWayOfTheWhiteClouds/White-Cloud-book/css/../img/hr-cloud.png: warning: can't open input file: No such file or directory
cpe-124-181-130-216:~ sambodhiprem$ 



I must be missing something?

Thanks again for your help.

http://sambodhiprem.com/

mikeday
Does the file exist? What output do you get if you run this command:
file /Volumes/Silent\ Sky/Dropbox/Websites/MyWayTheWayOfTheWhiteClouds/White-Cloud-book/css/../img/hr-cloud.png

Can you try running Prince again with the --debug option, and paste the log here?
sambodhiprem
When I output

file /Volumes/Silent\ Sky/Dropbox/Websites/MyWayTheWayOfTheWhiteClouds/White-Cloud-book/css/../img/hr-cloud.png


I get this:

/Volumes/Silent Sky/Dropbox/Websites/MyWayTheWayOfTheWhiteClouds/White-Cloud-book/css/../img/hr-cloud.png: cannot open `/Volumes/Silent Sky/Dropbox/Websites/MyWayTheWayOfTheWhiteClouds/White-Cloud-book/css/../img/hr-cloud.png' (No such file or directory)


Here's the log when I run:
$ prince --debug


I get:

cpe-124-181-130-216:~ sambodhiprem$ prince --debug
Usage:
  prince [OPTIONS] file.xml              Convert file.xml to file.pdf
  prince [OPTIONS] doc.html -o out.pdf   Convert doc.html to out.pdf
  prince [OPTIONS] FILES... -o out.pdf   Combine multiple files to out.pdf

Try 'prince --help' for more information.

cpe-124-181-130-216:~ sambodhiprem$ prince /Volumes/Silent\ Sky/Dropbox/Websites/MyWayTheWayOfTheWhiteClouds/White-Cloud-book/chapter01.html 
prince: /Volumes/Silent Sky/Dropbox/Websites/MyWayTheWayOfTheWhiteClouds/White-Cloud-book/css/mywaythewayofthewhiteclouds.css: warning: failed to parse all CSS rules
prince: /Volumes/Silent Sky/Dropbox/Websites/MyWayTheWayOfTheWhiteClouds/White-Cloud-book/css/../img/hr-cloud.png: warning: can't open input file: No such file or directory
prince: warning: cyclic @font-face redirect to "Droid Sans"
cpe-124-181-130-216:~ sambodhiprem$ 


I have a feeling that in my css file the

../


in front of

img/hr-cloud.png


is part of the problem. This png is a background image of an <hr> tag that I have setup in the css file. It's a dingbat that's in the html as an <hr> tag. In the css file the

../


is needed for the browser to find this image in the img folder. But perhaps using prince this creates problems?


I should probably add that each time I generate a pdf, I first enter:

$ prince 


then I drag the html file into the Terminal window and press return. Hope that's the best way to do it. Would love to know a quicker way, by the way.

Thank you for your help.


http://sambodhiprem.com/

Edited by sambodhiprem

mikeday
This would seem to indicate that the file does not exist:
/Volumes/Silent Sky/Dropbox/Websites/MyWayTheWayOfTheWhiteClouds/White-Cloud-book/css/../img/hr-cloud.png: cannot open `/Volumes/Silent Sky/Dropbox/Websites/MyWayTheWayOfTheWhiteClouds/White-Cloud-book/css/../img/hr-cloud.png' (No such file or directory)

What if you check for it directly, without the .. in the path:
file /Volumes/Silent\ Sky/Dropbox/Websites/MyWayTheWayOfTheWhiteClouds/White-Cloud-book/img/hr-cloud.png

Are there other images present in the img directory? Does the img directory even exist?

A quicker way of rerunning the same command is to press up/down to navigate through your command history, which saves retyping it.
sambodhiprem
I'm sorry, I had made a mistake… file was not present, but everything is working great now! And thank you for the press up/down tip - a time saver!
:-)

http://sambodhiprem.com/