I am trying to render some images, but I keep seeing this error message: Unknown image MIME type: text/html
When I view the HTML from the browser, bypassing Prince, everything looks fine and I can see the images. In the generated PDF I only see the ALT text.
Here is the relevant HTML snippet:
Here is the log output:
I checked with Firebug and the HTTP response looks like this:
We see this using the ASP.NET Development Server and also IIS on our production web server.
We are using the ASP.NET response feature like this:
This does not affect all images. We are in control of the encoding of most of these images, so we can change that if there is something strange we are doing or if Prince has strange requirements.
We are using Prince for Windows that I downloaded from princexml.com today. I have attached the exact file (it's obviously a test image, but it was uploaded and processed like the real ones) so that you can inspect it.
When I view the HTML from the browser, bypassing Prince, everything looks fine and I can see the images. In the generated PDF I only see the ALT text.
Here is the relevant HTML snippet:
<img src="http://localhost:8082/Photos/Arrests/057_TRN000000295X_Medium.jpg" alt="Image" />
Here is the log output:
Mon Nov 23 12:36:37 2009: ---- begin
Mon Nov 23 12:36:37 2009: Loading document...
Mon Nov 23 12:36:37 2009: http://localhost:8082/Photos/Arrests/057_TRN000000295X_Medium.jpg: warning: Unknown image MIME type: text/html
Mon Nov 23 12:36:37 2009: Converting document...
Mon Nov 23 12:36:37 2009: finished: success
Mon Nov 23 12:36:37 2009: ---- end
I checked with Firebug and the HTTP response looks like this:
Server ASP.NET Development Server/9.0.0.0
Date Mon, 23 Nov 2009 18:35:54 GMT
X-AspNet-Version 2.0.50727
Cache-Control private
Content-Type image/jpeg
Content-Length 8968
Connection Close
We see this using the ASP.NET Development Server and also IIS on our production web server.
We are using the ASP.NET response feature like this:
string path = _configuration.GetPrincePath();
var prince = new Prince(path);
prince.SetBaseURL(Request.Url.AbsoluteUri);
prince.SetLog("prince.log");
Response.Clear();
Response.Filter = new PrinceFilter(prince, Response.Filter);
Response.AddHeader("Content-Type", "binary/octet-stream");
Response.AddHeader("Content-Disposition", "attachment; filename=Report.pdf;");
This does not affect all images. We are in control of the encoding of most of these images, so we can change that if there is something strange we are doing or if Prince has strange requirements.
We are using Prince for Windows that I downloaded from princexml.com today. I have attached the exact file (it's obviously a test image, but it was uploaded and processed like the real ones) so that you can inspect it.