Hi,
I have written a program in RPG that generates a PDF file with a company logo and some text.
While I have had no problems with the text content, the image has me completely stumped. The first approach I tried was to use a jpeg along with the DCTDecode filter but that gives me an 'Out of memory' error when opening the PDF. The next method I tried was converting the image to an RGB based raw binary data file using GIMP and inserting this with no filter. This displays the image but the colours are wrong, my image has a white background with a blue and red logo on it. What I get however, is a grey background with a turquoise and blue logo!
My image file is 254w x 81h x 3 colours = 61,722 bytes. This is the exact size of the file and I have entered the length as 61,722, width as 254, height as 81, bitspercomponent as 8 which I believe is correct. Any other settings cause the image to not load at all anyway.
Any ideas where I am going wrong?
Thanks.
You have the colorspace specified correctly??
From: Adobe Forums <forums@adobe.com<mailto:forums@adobe.com>>
Reply-To: "jive-13749295-8igo-2-2hamn@mail.forums.adobe.com<mailto:jive-13749295-8igo-2-2hamn@mail.forums.adobe.com>" <jive-13749295-8igo-2-2hamn@mail.forums.adobe.com<mailto:jive-13749295-8igo-2-2hamn@mail.forums.adobe.com>>
Date: Thu, 26 Jan 2012 03:13:05 -0800
To: Leonard Rosenthol <lrosenth@adobe.com<mailto:lrosenth@adobe.com>>
Subject: Re: Trouble inserting image into PDF Trouble inserting image into PDF
Trouble inserting image into PDF
created by OnlyScreenNameLeft<http://forums.adobe.com/people/OnlyScreenNameLeft> in PDF Language and Specifications - View the full discussion<http://forums.adobe.com/message/4166159#4166159
Post a sample PDF
From: Adobe Forums <forums@adobe.com<mailto:forums@adobe.com>>
Reply-To: "jive-13749295-8igo-2-2hamv@mail.forums.adobe.com<mailto:jive-13749295-8igo-2-2hamv@mail.forums.adobe.com>" <jive-13749295-8igo-2-2hamv@mail.forums.adobe.com<mailto:jive-13749295-8igo-2-2hamv@mail.forums.adobe.com>>
Date: Thu, 26 Jan 2012 04:13:51 -0800
To: Leonard Rosenthol <lrosenth@adobe.com<mailto:lrosenth@adobe.com>>
Subject: Re: Trouble inserting image into PDF Trouble inserting image into PDF
Re: Trouble inserting image into PDF
created by OnlyScreenNameLeft<http://forums.adobe.com/people/OnlyScreenNameLeft> in PDF Language and Specifications - View the full discussion<http://forums.adobe.com/message/4166167#4166167
Can't figure out how to post the actual PDF but here is my code below:
%PDF-1.0
%§§§§
1 0 obj
<<
/Type /Pages
/Count 1
/Kids [2 0 R]
>>
endobj
2 0 obj
<<
/Type /Page
/MediaBox [0 0 595 842]
/Resources 3 0 R
/Parent 1 0 R
/Contents [4 0 R]
>>
endobj
3 0 obj
<<
/Font
<< /F0 << /Type /Font /BaseFont /Times-Italic /Subtype /Type1 >> >>
/XObject << /X2 6 0 R >>
>>
endobj
4 0 obj
<<
/Length 120
>>
stream
1. 0. 0. 1. 50. 700. cm
BT
/F0 36. Tf (Hello, World!) Tj
ET
q
1 0 0 1 10 10 cm
200 0 0 100 0 0 cm
/X2 Do
Q
endstream
endobj
5 0 obj
<<
/Type /Catalog
/Pages 1 0 R
>>
endobj
6 0 obj
<<
/Type /XObject
/Subtype /Image
/ColorSpace /DeviceRGB
/Length 61722
/Width 254
/Height 81
/BitsPerComponent 8
>>
stream
(61,722 bytes of raw image binary here)
endstream
endobj
xref
0 6
000000017 00000 n
000000081 00000 n
0000000196 00000 n
0000000323 00000 n
0000000496 00000 n
0000000551 00000 n
trailer
<<
/Size 6
/Root 5 0 R
>>
startxref
62436
%%EOF
Upload it to your favorite file sharing service and post a link.
From: Adobe Forums <forums@adobe.com<mailto:forums@adobe.com>>
Reply-To: "jive-13749295-8igo-2-2han1@mail.forums.adobe.com<mailto:jive-13749295-8igo-2-2han1@mail.forums.adobe.com>" <jive-13749295-8igo-2-2han1@mail.forums.adobe.com<mailto:jive-13749295-8igo-2-2han1@mail.forums.adobe.com>>
Date: Thu, 26 Jan 2012 04:31:17 -0800
To: Leonard Rosenthol <lrosenth@adobe.com<mailto:lrosenth@adobe.com>>
Subject: Re: Trouble inserting image into PDF Trouble inserting image into PDF
Re: Trouble inserting image into PDF
created by OnlyScreenNameLeft<http://forums.adobe.com/people/OnlyScreenNameLeft> in PDF Language and Specifications - View the full discussion<http://forums.adobe.com/message/4166173#4166173
North America
Europe, Middle East and Africa
Asia Pacific