• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Can't get a color logo to print in color

Community Beginner ,
Sep 07, 2011 Sep 07, 2011

Copy link to clipboard

Copied

PostScript newbie here... I have two issues with a postscript image I'm trying to print.

I have a green logo .eps file that I print to an HP color laserjet printer via a Linux server, but the logo only prints in greyscale.  I have reviewed the image code, and tweaked the code to specify color (e.g. changed the "image" command to "colorimage"), to no avail.  Can anyone assist me in getting a color printout?  Here's the main part of the code (specific image bits removed):

%!PS-Adobe-3.0 EPSF-3.0
%%TemplateBox:0 0 188 78
%%BoundingBox: 0 0 235 97
%%PageOrigin:0 0
/width 188 def
/height 78 def
/pixwidth 235 def
/pixheight 97 def
/picstr width string def
/dopic {
gsave
width height 8
[width 0 0 height neg 0 height]
{currentfile picstr readhexstring pop}
image
grestore
} def
pixwidth pixheight scale
dopic

.

.

(image bits here)

.

.

%%Trailer
showpage

The second issue is that I can't get the image to embed in another page - that is, when I call the image to print in a C program, the printer spits out the logo on a separate page.  The goal here is to embed a color logo (the .eps file) into a certificate, where the rest of the certificate contents are generated by PCL commands.  I've been able to embed a PCL image (too much aliasing) and an HPGL image (plotter print dulls sharp corners), but the .eps file doesn't want to play on the same page as the certificate.  Any ideas?

Any help is appreciated!

- Bry

TOPICS
Programming

Views

1.9K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Sep 08, 2011 Sep 08, 2011

Copy link to clipboard

Copied

EPS files should not have a showpage which is why it comes on it's own page.

To go from the 5 operand image to the 7 operand colorimage you need 2 more arguments

plus image data for each color. Image dictionaries are easier to work with such as

%!PS
10 10 scale
36 36 translate
/temp 4 string def
/DeviceCMYK setcolorspace
<<
  /ImageType 1
  /Width 8
  /Height 12
  /BitsPerComponent 1
  /Decode [ 0 1 0 1 0 1 0 1 ]
  /ImageMatrix [1 0 0 1 0 0]
  /DataSource { currentfile temp readhexstring pop }
>>
image
AA77A7C7F770AAC7EDEDEDED
AA77A7C7F770AAC7EDEDEDED
AA77A7C7F770AAC7EDEDEDED
AA77A7C7F770AAC7EDEDEDED
showpage

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Sep 08, 2011 Sep 08, 2011

Copy link to clipboard

Copied

Thanks, abeddie.

I tried your code header with my image code, to no avail (wouldn't print).  I tried your code exactly as you posted it and that didn't print either, so I'm not sure if you're just providing a snippet of larger code, or if I need to add your code somewhere into mine.  Can you elaborate?

I removed "showpage" from my code and inserted it into the overall print job, and it just doesn't print.  So, I'm still at square one.  Hopefully you or another user can help me connect the dots.

In the meantime, I'm going to try some different combinations of what you posted with my code to make sure I'm not missing something obvious.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Sep 08, 2011 Sep 08, 2011

Copy link to clipboard

Copied

That is complete code that just worked with gs and 2 Adobe PostScript printers.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Sep 09, 2011 Sep 09, 2011

Copy link to clipboard

Copied

Ghostscript only returns errors for me - I'll have to troubleshoot.

The greyscale image was printable from a basic command line lpr call.  So there's something in your code that either doesn't like to play with Unix or doesn't work with my HP printer (though, the fact that a greyscale image prints tells me the printer can handle postscript images).

I'll chew on this further.  If you have any other ideas or suggestions, I'd love to hear them.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Sep 09, 2011 Sep 09, 2011

Copy link to clipboard

Copied

My guess is something may have changed when you cut and pasted or typed the code into a file.

Here is an online PostScript to PDF converter which also worked on the simple color image.

http://www.ps2pdf.com/

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Sep 12, 2011 Sep 12, 2011

Copy link to clipboard

Copied

I found a resolution for the color issue.  As I mentioned before, I am trying to print an .eps image - out of frustration, I converted the image to .ps on the off chance that the printer would read the image differently.  Sure enough, the printer liked the .ps format and printed a color image.  Go figure.

Still can't get the logo to print in the body of the certificate, though.  I removed the showpage command from the end of the file and tried to reprint, but that just prevented the image from printing at all.  Some PostScript code investigation suggested that replacing showpage with the command show might do the trick - but no luck.

Still digging - I'll post the solution if and when I find it.  And as always, if you have other suggestions please post them.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Sep 12, 2011 Sep 12, 2011

Copy link to clipboard

Copied

LATEST

I'm going to move this part of the conversation to a new thread:  http://forums.adobe.com/thread/901714.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines