Quantcast
Channel: Adobe Community: Message List - Acrobat SDK
Viewing all articles
Browse latest Browse all 10848

Re: Are the Samples provided by Adobe of production quality?

$
0
0

lrosenth wrote:

 

The code in the snippet looks OK (other than the ASFree & return). Here is a variant of that code that is used in one of our utilities...

 

ASInt32 pathDataLen = PDEPathGetData(pdfPath, 0, 0);

ASInt32* pathData = new ASInt32[pathDataLen];

 

if (PDEPathGetData(pdfPath, pathData, pathDataLen) == pathDataLen)

{

pathDataLen /= sizeof(ASInt32);

 

for (ASInt32 i = 0; i < pathDataLen; ++i)

 

I am glad (actually, thrilled! Viva Adobe!!!) to report that the new code provided by our esteemed lrosenth works perfectly.

 

The older code (which has been distributed untouched since at least Acrobat 9 SDK):

 

      http://patriot.net/~ramon/misc/PDEPathExplorerSnip.cpp.txt  (2006 vintage)

 

doesn't even know when it is time to stop, and therefore a while is used in the main loop. The recent code knows in advance when to stop and thus a for loop is used. Additionally, in each subpath, the value of the i variable is incremented by one unit less in the new code (and, being consistent, in the case of 'h' closepath, i is untouched).

 

See my new images:

 

Original:

 

golfer.png

 

As understood by my plugin:

 

golfa.png

 

Finally, this is the type of image for which I am actually being remunerated. It used to look terribly (see above). Now it is flawless:

 

looking-good.png

 

Thanks again, Adobe guys!!!

 

-Ramon


Viewing all articles
Browse latest Browse all 10848

Trending Articles



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