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:
As understood by my plugin:
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:
Thanks again, Adobe guys!!!
-Ramon