Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rendering Images inside PDF, images not being rendered in PDF Viewer 0.1.8

Please check updates as they have additional informations... Apparently located the problem in a specific pdf client but cannot close the issue with an open bounty...

I am generating a pdf using grails rendering plugin. The PDF has a couple of images inside and "some" of them are not being outputted!

I am rendering the images inline via data uris as required by the plugin. That means that all my images are something like:

<img src="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQECWAJYAAD...">

If I render them in a normal html view, I can see the images just fine! If I render the template to a JPG/PNG with the same plugin, again the images render all fine.

If I render to PDF the images which are being retrieved by an octed-stream are broken!

Something like:

enter image description here

Looks like the image started to render and then something happened...

It is happening on the big-sized images, but also on the thumbnail version of same image.

Any one has some hints as why this might occur?

UPDATE

The file which does not show up is a file with mime application/octet-stream So apparently I can retrieve the bytes from the file, but when they transmitted for PDF Rendering, the image does not appear...

Yet another update The issue seems to be related with the PDF Viewer. Was using a Linux based PDF Viewer (PDF Viewer 0.1.8) and specific images are broken. In all other PDF Viewers I could test everything works fine. Cannot close the issue as there is a bounty open :( Sorry that the bounty and question seems meaningless now, but you never know, someone might have an idea how to solve this even for PDF Viewer 0.1.8.

like image 981
Al-Punk Avatar asked Jan 15 '14 10:01

Al-Punk


People also ask

How do I render a PDF image?

Open your PDF in Adobe Acrobat Pro and choose file. Export it to the new file format by going to the right pane and choosing “Export PDF” tool. Or, go to the menu and select “File” > “Export to” > “Image.”

Can you render a PDF file?

This being the case, all PDF viewers must be built on top of rendering functionality, although PDFs can also be rendered for printing or saving in the desired image format.

What is rendering in PDF?

PDF rendering is the term used to describe the translation and transport of (usually) web-based pages into PDF format directly on-screen and (usually) for onward use as a saved file, for despatch to a mobile device or for printing.


Video Answer


1 Answers

<img src="data:image/jpg;base64,/9j/4AAQSkZJRgABAQECWAJYAAD...">

works fine for me. Note the missing "e".

like image 199
gross.jonas Avatar answered Dec 09 '22 18:12

gross.jonas