1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

How do I tell if PDF is RGB or CMYK

Discussion in 'Photoshop' started by thevet, Feb 13, 2008.

  1. #1
    Hi guys. I was just wondering if there is an easy way to tell if a supplied print ready pdf is in either CMYK or RGB. Is there an add on you can get or a pdf reader that will display this.
     
    thevet, Feb 13, 2008 IP
  2. shahcloud

    shahcloud Peon

    Messages:
    95
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    i think all pdf file is RGB, correct me if i'm wrong.
     
    shahcloud, Feb 14, 2008 IP
  3. Bjam

    Bjam Well-Known Member

    Messages:
    501
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    108
    #3
    Try acrobat professional and do a preflight that will tell you
     
    Bjam, Feb 14, 2008 IP
  4. TecBrat

    TecBrat Member

    Messages:
    31
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    48
    #4
    I have been looking for a way to do this in PHP as part of my form validation script. I understand from some things I have read that I'd have to pull objects out of the PDF and test them individually, but I haven't figured out how to access the objects.
     
    TecBrat, May 4, 2009 IP
  5. innovati

    innovati Peon

    Messages:
    948
    Likes Received:
    63
    Best Answers:
    1
    Trophy Points:
    0
    #5
    you can certainly embed RGB objects in an otherwise CMYK document.

    I'm NOT an expert on PDF file structure, but from what I understand it's a Document Type, like lets say.....HTML. It doesn't have a switch saying either CMYK or RGB, any images or files you insert into it can EACH have their own colour profiles and colour modes, and when you save a PDF, you can force a conversion if you want.

    Remember, PDF is also larger than just CMYK or RGB, you can also do hexachrome, or any custom inks you wish, CMYK+spot colours. I don't know, short of actually running the file (as suggested before) you can determine what it contains.

    I think an important question for us to help answer you is: Why does it matter whether a PDF is RGB or CMYK for what you're trying to do?
     
    innovati, May 4, 2009 IP
  6. TecBrat

    TecBrat Member

    Messages:
    31
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    48
    #6
    Sorry if I am hijacking a thread, but I think it was abandoned anyway.

    We want to allow orders for print work to be accepted by an online shopping cart. The print house requires all artwork to be submitted in CMYK. Right now, I have set it to only allow JPG and PSD files to be uploaded because I can check their color modes as part of my server-side form validation. Some people might want to upload a PDF, and I'd like to allow it if I could check the color modes of the objects inside it.
     
    TecBrat, May 5, 2009 IP
  7. innovati

    innovati Peon

    Messages:
    948
    Likes Received:
    63
    Best Answers:
    1
    Trophy Points:
    0
    #7
    how do you make sure the JPG's you get are CMYK? In fact, is there such a thing as a real CMYK JPG? isn't that totally contrary to the entire purpose of the specification to begin with?

    I would accept the PDF's, and you might have to preflight them yourself, but then if there are errors, either fix it, or send it back to them. I'd just put a warning on it sayingsomething like: any files NOT CMYK when recieved will be converted by us and we're no liable for any colour matching isues that may result. Any files as CYMK will remain untouched and sent to print.

    It's a tricky issue, but I think it's harder to try to prevent the issue with code than to just deal with it using human power.
     
    innovati, May 5, 2009 IP
  8. TecBrat

    TecBrat Member

    Messages:
    31
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    48
    #8
    Yes, there is such a thing as a real CMYK JPG. Adobe PS makes them, and I am sure there are loads of other programs that do too. Here's my "is_cmyk" function.

    function is_cmyk($filename)
    // currently only works for jpg and psd. psd requires classPhpPsdReader.php by Tim de Koning
    {
      $matches=split('\.',$filename);
        foreach ($matches as $key=>$value)
        {
          $extension=$value; //if there is more than one period, this will find the actual extension.
        }
      switch ($extension)
      {
        case 'psd':
          include('classPhpPsdReader.php');
          $psd = new PhpPsdReader($filename);
          if($psd->infoArray['colorMode']==4)
          {
           return TRUE;
          }
          break;
        case 'jpg':
        $size = getimagesize($filename);
        //echo ("get image size found $size[channels] channels");
        if($size[channels]==4)
        {
         return TRUE;
        }
        default:
        return FALSE;
        break;
      }
      return FALSE;
    }
    
    PHP:
     
    TecBrat, May 6, 2009 IP
  9. innovati

    innovati Peon

    Messages:
    948
    Likes Received:
    63
    Best Answers:
    1
    Trophy Points:
    0
    #9
    there is such thing as a CMYK jpeg, but there can't be according to the JPEG scpeficiations - it's a hack, and although a common hack, not a widely supported hack.

    files like TIFF actually can be CMYK legitimately, and for print you want the best quality possible.....why you'd save an image in CMYK for print, but in low quality like JPEG is beyond me - it makes no sense!
     
    innovati, May 6, 2009 IP
  10. TecBrat

    TecBrat Member

    Messages:
    31
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    48
    #10
    If our artist makes the artwork, we submit it in PSD, but we accept 300dpi jpgs as well. At that resolution, there generally isn't any visable loss on the print work.

    I'm no expert on the specifications of JPEG, but I know it works.

    Back to my question though. Does anyone know how, in php, to get details about images imbedded in a pdf?
     
    TecBrat, May 7, 2009 IP
  11. free3dart

    free3dart Active Member

    Messages:
    241
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    51
    #11
    If you are preparing documents solely for the web, then for the same number of image samples RGB is negligibly faster with possibly smaller file size. If you are preparing documents for print, then CMYK is better since it preserves spot colors, and separating RGB may be unsatisfying or not possible. If you are preparing documents for both web and print CMYK is the better choice.

    There are cases though where you can’t always choose CMYK. Many PDF documents originally created using Microsoft or other PC applications will arrive in your shop as RGB. But there is no practical way to tell the unless you import into latest photoshop version and see the image for yourself or send it to printer.
     
    free3dart, May 7, 2009 IP