Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

JPEG Image not displaying (actually breaking previous content)

1 view
Skip to first unread message

Andy Jeffries

unread,
Dec 19, 2001, 9:17:57 AM12/19/01
to
Hi there,

I am trying alter pdf4php (free PDF generation unit for PHP) so that it
outputs JPEG images. I can't figure out why nothing is showing for this
PDF though (if I strip out all the "image" insertion code, the text
appears fine).

The structure is:

%PDF-1.3
4 0 obj
<<
/Type /XObject
/Subtype /Image
/Width 180
/Height 240
/ColorSpace /DeviceCMYK
/BitsPerComponent 8
/Length 7094
/Filter /DCTDecode
>>
stream
џиџр<....snip....>
endstream
endobj

5 0 obj
<</Type /Page
/Parent 2 0 R
/Resources 3 0 R
/MediaBox [0 0 595 822]
/Contents [6 0 R ]
>>
endobj

6 0 obj
<</Length 7 0 R
>>
stream
BT
/XObject << /Im4 4 0 R >>
q
1 0 0 1 10 10 cm
/Im4 Do
Q
0 0 0 rg
0 0 0 RG
/Times-Bold 10 Tf
0 Tr
10 TL
1 0 0 1 42 681 Tm
(Paid by:) Tj
1 0 0 1 42 671 Tm
<....snip....other....text_stuff....>
ET
endstream
endobj

7 0 obj
1770
endobj

1 0 obj
<<
/Type /Catalog
/Pages 2 0 R
>>
endobj

2 0 obj
<<
/Type /Pages
/Count 1
/Kids [4 0 R ]
>>
endobj

3 0 obj
<<
/ProcSet[/PDF /Text]
/Font <<
/Times-Bold 8 0 R
/Times 9 0 R
>>
>>
endobj

8 0 obj
<<
/Type /Font
/Subtype /Type1
/Encoding /MacRomanEncoding
/Name /Times-Bold
/BaseFont /Times-Bold
>>
endobj

9 0 obj
<<
/Type /Font
/Subtype /Type1
/Encoding /MacRomanEncoding
/Name /Times
/BaseFont /Times
>>
endobj

xref
0 10
0000000000 65535 f
0000009223 00000 n
0000009273 00000 n
0000009332 00000 n
0000000009 00000 n
0000007273 00000 n
0000007380 00000 n
0000009202 00000 n
0000009420 00000 n
0000009538 00000 n
trailer
<<
/Size 10
/Root 1 0 R
>>

startxref
9646
%%EOF


Any ideas what is wrong with this? Sorry, I'm a newbie to PDF
generation...but I've followed all the information I can find (Reference
Doc (Damn hard), Google web searches, Google groups, the FAQ for this
group).

Cheers,


--
Andy Jeffries | Scramdisk Linux Project
http://www.scramdisklinux.org | Lead developer

"testing? What's that? If it compiles, it is good, if it boots up
it is perfect."
--- Linus Torvalds

Aandi Inston

unread,
Dec 19, 2001, 9:35:28 AM12/19/01
to
Andy Jeffries <an...@andyjeffries.co.remove.uk> wrote:

>Hi there,
>
>I am trying alter pdf4php (free PDF generation unit for PHP) so that it
>outputs JPEG images. I can't figure out why nothing is showing for this
>PDF though (if I strip out all the "image" insertion code, the text
>appears fine).
>
>The structure is:
>
>%PDF-1.3
>4 0 obj
><<
>/Type /XObject
>/Subtype /Image
>/Width 180
>/Height 240
>/ColorSpace /DeviceCMYK
>/BitsPerComponent 8
>/Length 7094
>/Filter /DCTDecode
>>>
>stream
>џиџр<....snip....>
>endstream
>endobj

That looks OK.


>
>5 0 obj
><</Type /Page
>/Parent 2 0 R
>/Resources 3 0 R
>/MediaBox [0 0 595 822]
>/Contents [6 0 R ]
>>>
>endobj
>
>6 0 obj
><</Length 7 0 R
>>>
>stream
>BT
>/XObject << /Im4 4 0 R >>

What is this doing here? This belongs in the Resources dictionary!


>q
>1 0 0 1 10 10 cm
>/Im4 Do

Presuming the resource actually is in the dictionary, this will place
your image 10 points from the bottom left hand corner and one point
square. You may find it hard to see.

>Q
>0 0 0 rg
>0 0 0 RG
>/Times-Bold 10 Tf
>0 Tr
>10 TL
>1 0 0 1 42 681 Tm
>(Paid by:) Tj
>1 0 0 1 42 671 Tm
><....snip....other....text_stuff....>
>ET
>endstream
>endobj
>
>7 0 obj
>1770
>endobj
>

>3 0 obj
><<
>/ProcSet[/PDF /Text]
>/Font <<
>/Times-Bold 8 0 R
>/Times 9 0 R
>>>
>>>
>endobj

And the XObject resource is...?


>
>Any ideas what is wrong with this? Sorry, I'm a newbie to PDF
>generation...but I've followed all the information I can find (Reference
>Doc (Damn hard), Google web searches, Google groups, the FAQ for this
>group).

In general, PDF files aren't much use as text. It is almost always
better to post the PDF on a web or FTP site, and share the URL.
----------------------------------------
Aandi Inston qu...@dial.pipex.com http://www.quite.com
Please support usenet! Post replies and follow-ups, don't e-mail them.

Andy Jeffries

unread,
Dec 19, 2001, 9:42:15 AM12/19/01
to
On Wed, 19 Dec 2001 14:35:28 +0000, Aandi Inston wrote:
>>6 0 obj
>><</Length 7 0 R
>>>>
>>stream
>>BT
>>/XObject << /Im4 4 0 R >>
>
> What is this doing here? This belongs in the Resources dictionary!

OK, considering I am altering a unit written by someone else that up
until now hasn't done anything with images, is it likely to have a
resources dictionary? Sorry if that's a twatty question, but I'm very
new to PDF generation.

If not and I will have to start generating one, where should it go (in
the file) and what should it look like (can you give me an example based
on this simple PDF).

>>q
>>1 0 0 1 10 10 cm
>>/Im4 Do
>
> Presuming the resource actually is in the dictionary, this will place
> your image 10 points from the bottom left hand corner and one point
> square. You may find it hard to see.

Doh!!!! OK, I'll alter that.

> And the XObject resource is...?

I thought the XObject resource was defined at the top?

>>Any ideas what is wrong with this? Sorry, I'm a newbie to PDF
>>generation...but I've followed all the information I can find (Reference
>>Doc (Damn hard), Google web searches, Google groups, the FAQ for this
>>group).
>
> In general, PDF files aren't much use as text. It is almost always
> better to post the PDF on a web or FTP site, and share the URL.

http://www.andyjeffries.co.uk/sample.pdf

Thanks a lot.

Aandi Inston

unread,
Dec 19, 2001, 10:39:27 AM12/19/01
to
Andy Jeffries <an...@andyjeffries.co.remove.uk> wrote:

>On Wed, 19 Dec 2001 14:35:28 +0000, Aandi Inston wrote:
>>>6 0 obj
>>><</Length 7 0 R
>>>>>
>>>stream
>>>BT
>>>/XObject << /Im4 4 0 R >>
>>
>> What is this doing here? This belongs in the Resources dictionary!
>
>OK, considering I am altering a unit written by someone else that up
>until now hasn't done anything with images, is it likely to have a
>resources dictionary? Sorry if that's a twatty question, but I'm very
>new to PDF generation.

Yes, you already had one. It has an entry for Font resources, but you
need to add an entry for XObject resources. Also, when adding images
you need to review which ProcSet resources you have, otherwise you may
create a file that displays OK but refuses to print to PostScript
printers.

Andy Jeffries

unread,
Dec 19, 2001, 10:45:43 AM12/19/01
to
On Wed, 19 Dec 2001 15:39:27 +0000, Aandi Inston wrote:
>>OK, considering I am altering a unit written by someone else that up
>>until now hasn't done anything with images, is it likely to have a
>>resources dictionary? Sorry if that's a twatty question, but I'm very
>>new to PDF generation.
>
> Yes, you already had one. It has an entry for Font resources, but you
> need to add an entry for XObject resources. Also, when adding images
> you need to review which ProcSet resources you have, otherwise you may
> create a file that displays OK but refuses to print to PostScript
> printers.

OK, I added /Image in to the ProcSet portion and the XObject now seems to
be within the resource dictionary, but it's still not working, any ideas?

http://www.andyjeffries.co.uk/sample2.pdf

Aandi Inston

unread,
Dec 19, 2001, 10:51:49 AM12/19/01
to
Andy Jeffries <an...@andyjeffries.co.remove.uk> wrote:

>OK, I added /Image in to the ProcSet portion and the XObject now seems to
>be within the resource dictionary, but it's still not working, any ideas?
>
>http://www.andyjeffries.co.uk/sample2.pdf

Somehow, the Kids array of the Pages dictionary, which should contain
one or more Page dictionaries, contains instead an image XObject.
Probably not what you intended.

Andy Jeffries

unread,
Dec 19, 2001, 11:12:14 AM12/19/01
to
On Wed, 19 Dec 2001 15:51:49 +0000, Aandi Inston wrote:
>>OK, I added /Image in to the ProcSet portion and the XObject now seems
>>to be within the resource dictionary, but it's still not working, any
>>ideas?
>>
>>http://www.andyjeffries.co.uk/sample2.pdf
>
> Somehow, the Kids array of the Pages dictionary, which should contain
> one or more Page dictionaries, contains instead an image XObject.
> Probably not what you intended.

OK, I've fixed that (I've started user added objects at 20). However,
although the rest of the page is now showing, the image still isn't. Is
this due to the fact that I've got size 9 in the trailer and if so what
should it be? 20? 10 (9+1)?

Do my user added objects have to start consecutively after the last one
(9 I guess) or can they start at any number (as long as it's not used and
referred to later).

I feel I'm getting closer, thanks for your help so far.

Aandi Inston

unread,
Dec 19, 2001, 11:20:06 AM12/19/01
to
Andy Jeffries <an...@andyjeffries.co.remove.uk> wrote:

>OK, I've fixed that (I've started user added objects at 20). However,
>although the rest of the page is now showing, the image still isn't. Is
>this due to the fact that I've got size 9 in the trailer and if so what
>should it be? 20? 10 (9+1)?

Don't guess! See page 61 of the PDF Reference. If the value is too
low, objects beyond the count you give will vanish from the file.


>
>Do my user added objects have to start consecutively after the last one
>(9 I guess) or can they start at any number (as long as it's not used and
>referred to later).

You're getting beyond what I can answer from memory, but I think you
should probably use consecutive numbers to avoid having to generate
free entries in the xref table.

Andy Jeffries

unread,
Dec 19, 2001, 11:38:54 AM12/19/01
to
On Wed, 19 Dec 2001 16:20:06 +0000, Aandi Inston wrote:
>>Do my user added objects have to start consecutively after the last one
>>(9 I guess) or can they start at any number (as long as it's not used
>>and referred to later).
>
> You're getting beyond what I can answer from memory, but I think you
> should probably use consecutive numbers to avoid having to generate free
> entries in the xref table.

OK, now using consecutive numbers, still not showing damn!!!

If you or anyone else can help, I'd be very grateful!!

Thanks for all your help to date though, if you can't/don't have time.

http://www.andyjeffries.co.uk/sample4.pdf

Aandi Inston

unread,
Dec 19, 2001, 12:29:49 PM12/19/01
to
Andy Jeffries <an...@andyjeffries.co.remove.uk> wrote:

>On Wed, 19 Dec 2001 16:20:06 +0000, Aandi Inston wrote:
>>>Do my user added objects have to start consecutively after the last one
>>>(9 I guess) or can they start at any number (as long as it's not used
>>>and referred to later).
>>
>> You're getting beyond what I can answer from memory, but I think you
>> should probably use consecutive numbers to avoid having to generate free
>> entries in the xref table.
>
>OK, now using consecutive numbers, still not showing damn!!!

I now get specific error messages, do you get the same?

Illegal operation 'q' inside a text object
[that is, between BT and ET]

The font 'Times' contains a bad /BBox

Could not find the XObject named 'im1'
[Check the resources dictionary and naming carefully]

Andy Jeffries

unread,
Dec 20, 2001, 5:27:35 AM12/20/01
to
On Wed, 19 Dec 2001 17:29:49 +0000, Aandi Inston wrote:
> I now get specific error messages, do you get the same?

Not in xpdf, but in Acroread I now get one of the messages.

> Illegal operation 'q' inside a text object [that is, between BT and ET]

OK, I've fixed this one.

> The font 'Times' contains a bad /BBox

I also get this? Do you know what it means? I haven't done anything
with /BBox (in fact I haven't touched the text handling at all).

> Could not find the XObject named 'im1' [Check the resources dictionary
> and naming carefully]

Maybe I'm being daft, but I can't see any problem here.

I've uploaded the latest one as:

http://www.andyjeffries.co.uk/sample5.pdf

Thanks.

Aandi Inston

unread,
Dec 20, 2001, 7:26:29 AM12/20/01
to
Andy Jeffries <an...@andyjeffries.co.remove.uk> wrote:
>
>> Could not find the XObject named 'im1' [Check the resources dictionary
>> and naming carefully]
>
>Maybe I'm being daft, but I can't see any problem here.
>
>I've uploaded the latest one as:
>
>http://www.andyjeffries.co.uk/sample5.pdf

Walking through the objects using Enfocus browser I find

Info dictionary seems to be missing

You are using the non-standard font Times with no FontDescriptor (the
standard font is Times-Roman).

Something is wrong with the object for xobject im1, since it raises an
exception in Acrobat. Perhaps this is because the name im1 appears in
the XObject without a /

Herbert Kleebauer

unread,
Dec 20, 2001, 7:36:00 AM12/20/01
to

Andy Jeffries wrote:

>
> I've uploaded the latest one as:
>
> http://www.andyjeffries.co.uk/sample5.pdf
>

It's long ago when I wrote a program to generate a pdf file, but
I think there is something wrong with your:

9 0 obj
<<
/Type /XObject
/Subtype /Image
/Name im1
/Width
/Height
/Width
/Height
/ColorSpace /DeviceRGB


/BitsPerComponent 8
/Length 7094
/Filter /DCTDecode
>>
stream

Here is the code generated by my program
(ftp://137.193.64.130/pub/pdf/makepdf.zip):

24 0 obj
<< /Type /XObject /Subtype /Image /Name /Im1 /Width 135 /Height 99
/BitsPerComponent 8 /ColorSpace /DeviceRGB /Length 25 0 R /Filter /DCTDecode >>
stream

Andy Jeffries

unread,
Dec 20, 2001, 7:54:42 AM12/20/01
to
On Thu, 20 Dec 2001 12:26:29 +0000, Aandi Inston wrote:
>>> Could not find the XObject named 'im1' [Check the resources dictionary
>>> and naming carefully]
>>
>>Maybe I'm being daft, but I can't see any problem here.
>>
>>I've uploaded the latest one as:
>>
>>http://www.andyjeffries.co.uk/sample5.pdf
>
> Walking through the objects using Enfocus browser I find
>
> Info dictionary seems to be missing

What is an Info dictionary, what should it look like and where should it
be? Thanks.

> You are using the non-standard font Times with no FontDescriptor (the
> standard font is Times-Roman).

OK, I've altered it to use the name Times-Roman and that seems to have
got rid of that error.

> Something is wrong with the object for xobject im1, since it raises an
> exception in Acrobat. Perhaps this is because the name im1 appears in
> the XObject without a /

OK, changed that, but still no joy in displaying the image. Acrobat
Reader gives me an error 16 when starting, but it displays everything
else fine.

http://www.andyjeffries.co.uk/sample6.pdf

Cheers,

Andy Jeffries

unread,
Dec 20, 2001, 8:01:01 AM12/20/01
to
On Thu, 20 Dec 2001 12:54:42 +0000, Andy Jeffries wrote:
>> Info dictionary seems to be missing
>
> What is an Info dictionary, what should it look like and where should it
> be? Thanks.
>
>> You are using the non-standard font Times with no FontDescriptor (the
>> standard font is Times-Roman).
>
> OK, I've altered it to use the name Times-Roman and that seems to have
> got rid of that error.
>
>> Something is wrong with the object for xobject im1, since it raises an
>> exception in Acrobat. Perhaps this is because the name im1 appears in
>> the XObject without a /
>
> OK, changed that, but still no joy in displaying the image. Acrobat
> Reader gives me an error 16 when starting, but it displays everything
> else fine.
>
> http://www.andyjeffries.co.uk/sample6.pdf

Oops, change that to be:

http://www.andyjeffries.co.uk/sample7.pdf

Fixed a bug that Herbert pointed out.

Andy Jeffries

unread,
Dec 20, 2001, 8:03:38 AM12/20/01
to

The only differences I can see are the /Length, the /Name and the /Width
& /Height. I've fixed the /Name one (as per Aandi's post) but I don't
know if the length should be changed?

I have also inserted the /Width and /Height again correctly (only appears
once in the object and has values). However, it's still not displaying.
Acrobat Reader now says "Bad error code".

http://www.andyjeffries.co.uk/sample7.pdf

How can I determine if it is using DCT and if it is DeviceRGB. They are
the only examples I can find for including JPEG images, but I don't know
if they are right.

Cheers,

Filiep Maes

unread,
Dec 20, 2001, 8:46:57 AM12/20/01
to
> http://www.andyjeffries.co.uk/sample7.pdf
look at it with our Enfocus Browser, according to the browser there is no
data in the image stream. When I look with a hex editor then I can see that
there is indeed data in the stream..endstrem object. So there is something
wrong with the filter or the characters following the token stream are not
correct. The character following the token stream is in your case 0A (hex)
and I think it must be 0D0A (in hex). Even if the rest of the PDF is using
0A as line ending.

An other thing that I noticed is that there are path command between your BT
and ET token (look for m, l and S in the content)

hope this helps

Filiep Maes
Enfocus Software


Andy Jeffries

unread,
Dec 20, 2001, 8:54:42 AM12/20/01
to
On Thu, 20 Dec 2001 13:46:57 +0000, Filiep Maes wrote:
>> http://www.andyjeffries.co.uk/sample7.pdf
> look at it with our Enfocus Browser

Hi there, do you have a Linux version of your browser? Or do you know if
it runs under Wine?

> according to the browser there is
> no data in the image stream. When I look with a hex editor then I can
> see that there is indeed data in the stream..endstrem object. So there
> is something wrong with the filter or the characters following the token
> stream are not correct.

OK...

> The character following the token stream is in
> your case 0A (hex) and I think it must be 0D0A (in hex). Even if the
> rest of the PDF is using 0A as line ending.

OK...I'll try altering that to be \r\n instead of \n. Thanks.

> An other thing that I noticed is that there are path command between
> your BT and ET token (look for m, l and S in the content)

Path commands meaning line drawing commands? Is this an issue? I am
amending a PHP unit written by someone else and quite frankly don't have
much of a clue about PDF files (learning as I go as the PDF Reference
isn't too easy to pick up!!).

I'll try the \r\n suggestion first and find out. Would this problem
occur if it doesn't use DCT (if so what are the alternatives?) or
RGB (CMYK or something).

Andy Jeffries

unread,
Dec 20, 2001, 8:56:46 AM12/20/01
to
On Thu, 20 Dec 2001 13:54:42 +0000, Andy Jeffries wrote:
>> The character following the token stream is in your case 0A (hex) and I
>> think it must be 0D0A (in hex). Even if the rest of the PDF is using 0A
>> as line ending.
>
> OK...I'll try altering that to be \r\n instead of \n. Thanks.

No joy, http://www.andyjeffries.co.uk/sample8.pdf

Filiep Maes

unread,
Dec 20, 2001, 9:22:19 AM12/20/01
to
played with your file in an hex editor, if I disable the filter (and change
the width and heigth) then I am able to view something. It seems that there
is problem with the filter.

> Hi there, do you have a Linux version of your browser?

No, only Win and MacOS

>Or do you know if it runs under Wine?

we never tried it ...

>Path commands meaning line drawing commands? Is this an issue?

yes, this is a problem, when you open the file in full Acrobat you get a
warning about this.

Filiep Maes
Enfocus Software


Herbert Kleebauer

unread,
Dec 20, 2001, 9:27:12 AM12/20/01
to

Andy Jeffries wrote:

> No joy, http://www.andyjeffries.co.uk/sample8.pdf

As already been said: there must not be a m command
within BT and ET (Reader 3+4 didn't complain but
Reader 5 gives an error). And your jpeg image seems
to be corrupted. Take a normal jpeg file and insert it
without modification.

Andy Jeffries

unread,
Dec 20, 2001, 9:31:33 AM12/20/01
to
On Thu, 20 Dec 2001 14:27:12 +0000, Herbert Kleebauer wrote:
>> No joy, http://www.andyjeffries.co.uk/sample8.pdf
>
> As already been said: there must not be a m command within BT and ET
> (Reader 3+4 didn't complain but Reader 5 gives an error).

Right....that's going to make my life fun!!! :-)

> And your jpeg
> image seems to be corrupted. Take a normal jpeg file and insert it
> without modification.

I did!!! . Aside from ASCII85 (which I'd never heard of before),
could I encode the raw data with something else, maybe base64 or
something?

Andy Jeffries

unread,
Dec 20, 2001, 9:33:38 AM12/20/01
to
On Thu, 20 Dec 2001 14:22:19 +0000, Filiep Maes wrote:
> played with your file in an hex editor, if I disable the filter (and
> change the width and heigth) then I am able to view something. It seems
> that there is problem with the filter.

OK, what did you change the width and height to, to get it to display
something?

Also, the original JPEG is up at http://www.andyjeffries.co.uk/test.jpg
Does this seem like an OK image (DCT or whatever)?

>> Hi there, do you have a Linux version of your browser?
> No, only Win and MacOS

Damn...

>>Or do you know if it runs under Wine?
> we never tried it ...

Hmmm, I'll give it a go sometime and let you know. Does it require lots
of libraries or just a single executable?

>>Path commands meaning line drawing commands? Is this an issue?
> yes, this is a problem, when you open the file in full Acrobat you get a
> warning about this.

Right, looks like I've got to rework more of this guy's code...

Herbert Kleebauer

unread,
Dec 20, 2001, 9:41:37 AM12/20/01
to

Andy Jeffries wrote:

> > And your jpeg
> > image seems to be corrupted. Take a normal jpeg file and insert it
> > without modification.
>
> I did!!! . Aside from ASCII85 (which I'd never heard of before),
> could I encode the raw data with something else, maybe base64 or
> something?

I put the bytes between stream and endstream in a file, but it
couldn't be displayed with a jpeg viewer (e.g. Netscape).
Try to include a complete jpeg file (with all headers) into
your pdf file.

Herbert Kleebauer

unread,
Dec 20, 2001, 9:45:43 AM12/20/01
to

Andy Jeffries wrote:
>
> Also, the original JPEG is up at http://www.andyjeffries.co.uk/test.jpg
> Does this seem like an OK image (DCT or whatever)?

This image is 5997 byte long, but you included only 4718 byte.

Andy Jeffries

unread,
Dec 20, 2001, 9:43:43 AM12/20/01
to

To be honest, I just read it in (using file in PHP) to an array and then
join all of the lines of the array in to one long data block (implode in
PHP).

The sample image is up on: http://www.andyjeffries.co.uk/test.jpg

I have to be honest though, I'm about ready to give up. In trying to
move the line drawing commands out of the main block, I've now managed to
lose half the content on the page (which is MUCH more of a worry given
this is for a paid project).

Aandi Inston

unread,
Dec 20, 2001, 9:49:30 AM12/20/01
to
Andy Jeffries <an...@andyjeffries.co.remove.uk> wrote:

>On Thu, 20 Dec 2001 12:26:29 +0000, Aandi Inston wrote:
>>>> Could not find the XObject named 'im1' [Check the resources dictionary
>>>> and naming carefully]
>>>
>>>Maybe I'm being daft, but I can't see any problem here.
>>>
>>>I've uploaded the latest one as:
>>>
>>>http://www.andyjeffries.co.uk/sample5.pdf
>>
>> Walking through the objects using Enfocus browser I find
>>
>> Info dictionary seems to be missing
>
>What is an Info dictionary, what should it look like and where should it
>be? Thanks.

The tool I was using misled me into thinking you had an Info
dictionary that was malformed. In fact, it is missing, which is legal
PDF. However, I wish it wasn't. The Info dictionary contains
"Producer" and "Creator" fields which can be used, if properly filled
in, to track down the software that made a particular PDF. This is
very important in helping deal with problem PDFs, so I'd recommend
filling this in. Start on page 61, table 3.11.


>
>> You are using the non-standard font Times with no FontDescriptor (the
>> standard font is Times-Roman).
>
>OK, I've altered it to use the name Times-Roman and that seems to have
>got rid of that error.
>
>> Something is wrong with the object for xobject im1, since it raises an
>> exception in Acrobat. Perhaps this is because the name im1 appears in
>> the XObject without a /
>
>OK, changed that, but still no joy in displaying the image. Acrobat
>Reader gives me an error 16 when starting, but it displays everything
>else fine.

Tip: if you get a numbered error, use Ctrl+OK to find the text of the
message. Take the message, then look closely at your Image XObject,
you should see the problem.

Bart Lateur

unread,
Dec 20, 2001, 9:53:57 AM12/20/01
to
Andy Jeffries wrote:

>To be honest, I just read it in (using file in PHP) to an array and then
>join all of the lines of the array in to one long data block (implode in
>PHP).

Did you read in the file in binary mode?

--
Bart.

Andy Jeffries

unread,
Dec 20, 2001, 9:55:42 AM12/20/01
to

EXCELLENT!!!!

I've now got the image displaying on the page. Turns out "file" in PHP
is not binary-safe. Should really have known that, but I haven't really
had to work with binary files before in PHP.

Anyway, the image is now displaying. I am going to try and get the text
displaying again. Once that all works, I may try and work in the changes
to move the lines out of the text block, but I'll wait and see.

Andy Jeffries

unread,
Dec 20, 2001, 10:05:56 AM12/20/01
to

Yes, thanks, this was the problem!!!

Unfortunately I had already noticed this when Herbert pointed out the
file length difference, but thanks anyway.

It now seems to be working fine!!!

Andy Jeffries

unread,
Dec 20, 2001, 10:08:08 AM12/20/01
to
Thanks to everyone that's helped.

I've now got the image displaying on the page. Still have to work out
all this stuff about sizing and positioning, but it displays.

Sometime I may worry about moving the drawing stuff out of the text area
(which is illegal, so I'm told, for version 5 documents). However, it
now works for me. If it works for the client, then it's not so much of
an issue.

Thanks again, although it's been a hard slog, I'm very grateful for all
your help!!!


Cheers,


Andy

0 new messages