Color Conversion for all Elements

Ask a Question related to Adobe Acrobat SDK, Design and Development.

  1. #1

    Default Color Conversion for all Elements

    Hi,
    I am writing some plug in which can convert Color of the PDF for that i have used "PDDocColorConvertPage" it is perfectly working well for Grayscale Conversion, But the same method is not working for the Pantone (SpotColor) to CMYK conversion, so i tried with PDColorConvertPDEElement but i don't get the proper sample to use that function. I was blocked, please help me out to find the best method for color conversion problem.

    Regards,
    Kumar.K
    KUMARARAJA@adobeforums.com Guest

  2. Similar Questions and Discussions

    1. Process to Spot Color Conversion
      Is there any way to find the approximate equivalent spot colour for a Pantone process colour? I want to find a spot colour similar to Pantone DS...
    2. Wholesale conversion of color palette
      I'm evaluating Adobe Illustrator and like most of what I have seen. The methods of getting there, however, are a little different than my mindset....
    3. Color Conversion
      I am trying to convert Word documents containing some colored texts to pdf in gray scale only. I am working with Win 2000 and Office XP with Acrobat...
    4. Set Color to Elements in my control
      I am trying to set HTML elements in my server control to the ForeColor setting for the control. For example I create a server control which I inherit...
    5. Converting a color negative .jpg to a color positive image .jpg in Photoshop Elements 2.0
      My scanner will convert color photo negatives to a positive image which I can then adjust using Photoshop Elements. However, it is much faster to...
  3. #2

    Default Re: Color Conversion for all Elements

    What do you mean it is "not working"? Please explain.

    also, what version of Acrobat are you using?
    Leonard_Rosenthol@adobeforums.com Guest

  4. #3

    Default Re: Color Conversion for all Elements

    I am using Acrobat 9, Here i am giving the code which working now, in that my objective is to change all the elements to Grayscale, but i am sure that i did some mistakes, Please let me know where i made the mistake

    Code:
    -----
    AVDoc avDoc = AVAppGetActiveDoc();
    char str[256];
    ASPathName aoPDFPathName = NULL;
    char* OutputPdfFileName = "C:\\Output.pdf";
    ASText pathText = ASTextNew();
    ASFileSys aoFileSys = NULL;
    pathText = ASTextFromScriptText(OutputPdfFileName, kASRomanScript);
    aoFileSys = ASGetDefaultFileSysForPath(ASAtomFromString("ASTex tPath"), pathText);

    if(avDoc==NULL)
    {
    sprintf(str,"There is no PDF document loaded in Acrobat.");
    }
    else
    {
    PDDoc pdDoc = AVDocGetPDDoc (avDoc);
    int numPages = PDDocGetNumPages (pdDoc);
    ASInt32 ai, aiNumElems;
    PDEContent aoPDEContent = NULL;
    PDEElement aoPDEElement;
    PDPage aoPage = NULL;
    aoPage = PDDocAcquirePage(pdDoc, 0);
    aoPDEContent = PDPageAcquirePDEContent(aoPage, 0);
    aiNumElems = PDEContentGetNumElems(aoPDEContent);
    sprintf(str,"The active PDF Page has %d Elements.", aiNumElems);

    AC_Profile prof;
    ACProfileFromCode(&prof, AC_Profile_DotGain15);
    for (ai = 0; ai < aiNumElems; ai++) { aoPDEElement = PDEContentGetElem(aoPDEContent, ai); PDColorConvertPDEElement(pdDoc, aoPDEElement, prof, AC_UseProfileIntent, true); } if (aoPDEContent != NULL){ PDPageReleasePDEContent(aoPage, 0); } // inform the user if we have done a color conversion. if(ASBoolToBool(gbConverted) == true) AVAlertNote("Color transform has been done to Gray"); else AVAlertNote("No color transform was made.");

    aoPDFPathName = ASFileSysCreatePathName (aoFileSys, ASAtomFromString("ASTextPath"), pathText, 0);
    PDDocSave (pdDoc, PDSaveFull | PDSaveCollectGarbage | PDSaveLinearized, aoPDFPathName, ASGetDefaultUnicodeFileSys(),NULL, NULL);
    PDDocClose (pdDoc);
    ACUnReferenceProfile(prof);
    }

    Thanks,
    Kumar.K
    KUMARARAJA@adobeforums.com Guest

  5. #4

    Default Re: Color Conversion for all Elements

    I don't want to read your code - I want to understand why you think that it's not working for spot/pantone colors.
    Leonard_Rosenthol@adobeforums.com Guest

  6. #5

    Default Re: Color Conversion for all Elements

    Still Spot color is present in the Output PDF file which i am saving, Convertion is not done from Pantone to CMYK, that is why i am thinking that some thing is missing while using PDColorConvertPDEElement.
    KUMARARAJA@adobeforums.com Guest

  7. #6

    Default Re: Color Conversion for all Elements

    You need to set/pass the correct color conversion params
    Leonard_Rosenthol@adobeforums.com Guest

  8. #7

    Default Re: Color Conversion for all Elements

    I am getting This error

    "There is no source code available for the current location."

    while the debugging the code

    "PDColorConvertPDEElement(pdDoc, aoPDEElement, prof, AC_UseProfileIntent, true);"

    What is the problem?

    but in the same plugin PDDocColorConvertPage function is working fine.
    KUMARARAJA@adobeforums.com Guest

  9. #8

    Default Re: Color Conversion for all Elements

    Right - you don't have the source code to the PDFLibraries and as such you can't debug into that API call.
    Leonard_Rosenthol@adobeforums.com Guest

  10. #9

    Default Re: Color Conversion for all Elements

    So, PDColorConvertPDEElement is not for Acrobat SDK?

    but in the Help i found

    PDColorConvertPDEElement ()
    Product availability: Acrobat, PDFL
    Platform availability: Macintosh, Windows, UNIX

    If it is not for Acrobat, then through which method i can change the color of the each elements?

    Please direct me.

    Thanks
    KUMARARAJA@adobeforums.com Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139