Quantcast
Channel: Adobe Community : All Content - Acrobat SDK
Viewing all articles
Browse latest Browse all 2571

Pdf Color Conversion (to RGB)

$
0
0

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


Viewing all articles
Browse latest Browse all 2571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>