Question

I have a report in Cognos. The output is rendered in a pdf inside the browser itself. Now the images are not showing up in the pdf. They show up fine in html. Now if they were not showing up on html, i would do a view source and check the image url and go from there. But when a pdf is rendered inside a browser, is there a way to do some kind of a 'View Source'?

Was it helpful?

Solution

As already recommended in comments, use a PDF browser like RUPS (based on iText) or any other one. Select the desired page, open its /Contents value, select the stream and you'll see something like this

/T1_0 1 Tf
0.0004 Tc -0.0002 Tw 13.98 0 0 13.98 189.87 476.67 Tm
(Praise for the First Edition)Tj
/T1_1 1 Tf
0.056 Tw 9.99 0 0 9.99 108.18 437.34 Tm
[(Each aspect is explained with numer)19(ous ex)]TJ

where text is to be displayed. Commands ending with Tf select the font for the text, those ending with Tc or Tw select the character or word spacing, those ending with Tm manipulate the text matrix and so position, rotate, stretch, etc. the text to be printed, and those ending with Tj or TJ actually print text.

Or you'll see something like this:

533.352005 0 0 668.2319946 -1.2660065 -1.0559998 cm
/Im0 Do

where some XObject is to be displayed. Commands ending with cm manipulate the current transformation matrix (again for positioning, rotating, stretching, etc.), and those ending with Do print a XObject.

What a given XObject is, can be seen in the /XObject value in the /Resources of the page, e.g.:

enter image description here

So the XObject is an image (see the value of /Subtype).

Therefore in your case

Now the images are not showing up in the pdf.

you should inspect the page in a likewise manner and search for something like the excerpts above. If you don't find a XObject referenced (and also don't find a command sequence BI … Key-value pairs … ID … Image data … EI in a contents stream; that sequence defines an inlined image), there is no image on that PDF page. Otherwise there is an image which for some reason does not show up.

There actually can be a number of other commands, too, and also other kinds of XObjects. For more details have a look at the PDF specification ISO 32000-1:2008 (made available by Adobe here), especially chapters 8 and 9.

OTHER TIPS

... or search the web for the exact problem

http://www-01.ibm.com/support/docview.wss?uid=swg21339267

Although it doesn't explain why it works for HTML and PDF, most searches indicate that it is a web server security problem, and enabling anonymous authentication in your images folder might fix it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top