I discover this way to convert the pdf pages color to RGB using the Acrobat API in a custom plugin and Acrobat 10 Pro:
PDColorConvertAction colorConvertActionStruct = (PDColorConvertAction)malloc(sizeof(PDColorConvertActionRec)); memset(colorConvertActionStruct, 0, sizeof(PDColorConvertAction)); PDColorConvertActionType actionType = kColorConvConvert; colorConvertActionStruct->mAction = actionType; colorConvertActionStruct->mMatchAttributesAny = -1; colorConvertActionStruct->mMatchSpaceTypeAny = -1; colorConvertActionStruct->mMatchIntent = AC_UseProfileIntent; colorConvertActionStruct->mConvertIntent = AC_UseProfileIntent; colorConvertActionStruct->mEmbed = true; colorConvertActionStruct->mPreserveBlack = false; colorConvertActionStruct->mUseBlackPointCompensation = false; AC_Profile rgbProfile; ACProfileFromCode(&rgbProfile, AC_Profile_AdobeRGB1998); colorConvertActionStruct->mConvertProfile = rgbProfile; PDColorConvertParams colorConvertParamsStruct = (PDColorConvertParams)malloc(sizeof(PDColorConvertParamsRec)); memset(colorConvertParamsStruct, 0, sizeof(PDColorConvertParams)); colorConvertParamsStruct->mActions = colorConvertActionStruct; colorConvertParamsStruct->mNumActions = 1; colorConvertParamsStruct->mInks = NULL; colorConvertParamsStruct->mNumInks = 0; ASBool *changed; PDDocColorConvertPage(pdDoc, colorConvertParamsStruct, 1, NULL, NULL, 0, NULL, changed); ACUnReferenceProfile(rgbProfile);
the problem is that I get an error of read memory violation at this line
...
PDDocColorConvertPage(pdDoc, colorConvertParamsStruct, 1, NULL, NULL, 0, NULL, changed);
...
actually when it's performing the color conversion.
Is there any reason because I get the error?
Thank you very much