Forum How do I...?

Images not showing up in the pdf

neelima_kaja
I am having a problem with images not showing up in the pdf.
When I view the log it shows a warning: The requested URL returned error: 400
What could be the reason for this?
mikeday
This is the HTTP "bad request" error code, that usually indicates a misconfiguration on the client or server, or something wrong with the URL. Can you try using curl or wget to access the URL and see if you get the same error?
sunny
I'm having experiencing the same issue and can't figure it out.

Prince is output the "warning: The requested URL returned error: 400" on some of the images. And it appears like it's always doing it on those same set of images. But there's nothing special about them. And I can access these images just fine both on the browser and through CURL.

And here's the weird part. Previouly this is how I ran it: "prince temp/page.html -o pdf/page.pdf" And while I was debuging I went into the "temp" folder and ran it like this: "prince page.html -o ../pdf/page.pdf". And guess what? It worked! But... why? how? But the bad news is that while this worked for "page.html", it started producing the same "400 error" on other page that used to work worked before when I ran it like "prince temp/page.html -o pdf/page.pdf". So this is just weird and doesn't make sense (at least to me).

The apache log file didn't show anything useful. The error didn't any have anything. But I did notice that the access log file occassionally produces weird entries when Prince retrieves documents:

74.208.70.134 - - [12/Mar/2010:13:53:45 -0500] "GET /web/generate_image.php?code=154232 HTTP/1.1" 200 11301 "\x80w\xbf\b\x80w\xbf\bal/lib/prince/etc/curl-ca-bundle.crt" "Prince/7.0 (http://www.princexml.com)"

What are all those weird characters (\x80w\xbf\b\x80w...)? Is this normal?

Sunny
mikeday
That looks a bit wrong. Which operating system are you running Prince on? Is it a http or https URL? Is it a public URL that we can access from here?
sunny
Hi,

I'm running this on a linux platform (also local to the web server). It's HTTP and publically accessible. The command line works just fine for 9 of the 10 PDF files I'm generating. And like I mentioned in the previous post, depending on how I run it "prince temp/page.html -o pdf/page.pdf" VS "cd temp; prince page.html -o ../pdf/page.pdf", produces different result. I don't know why that should make any difference. Otherwise, the behavior seems very random.

Any idea?
Sunny
mikeday
Can you email me (mikeday@yeslogic.com) the URL or HTML that you are running Prince on, so that we can debug the problem here?
neelima_kaja
Hello,
We set the baseurl property to the directory where the images were and it solved the problem. I don't know if that is a new requirement with Prince 7 or not that is what helped us.

Thanks,
Neelima