Planet PDF Forum Archive

Planet PDF ForumWowsers! This is page is old, head to the LIVE Planet PDF Forum. It features more than 10 conferences, covering everything from beginner to in-depth developer and pre-press discussions. If you wish to continue... one & two archive covers 1999-2011 (160,000 pages).


New Forum | Previous | Next | (P-PDF) Developers


Topic: PDEPath GraphicState.color Acrobat bug? , 4 Attachments
Conf: (P-PDF) Developers, Msg: 131091
From: jbigonz
Date: 4/14/2005 08:15 AM

Hi Developers,

I have a problem with PDEPath's GState - especially with colors.
I have a document with PDEPath objects, where some of the objects have specified fill color anothers stroke colors. All objects has ON overprint property. The objects color is a spot color.

I need to process the objects based on its color value, but in some cases I get wrong colors in graphicstate.

If the PDF contains PDEPath objects with fill or with stroke colors it is working fine.
But not when fill and stroke objects are mixed.

When I add PDEPath with stroke (fill) color into document consist from PDEPath with fill (stroke) color, the added path will have changed its fill (stroke) color value from 0 to 65536. Please examine the source and the output below.
PDF files are attached too.

Can anybody tell me, why going to be changed the colors after adding? The objects was added by PitStop.
After adding I tryed with PitStop looking the colors, but it seems ok. (Gray square has just fill color, Purple line just stroke color), but my source get another result with files FIll_Stroke.pdf and Stroke_Fill.pdf

I am doing something wrong or this is an Acrobat bug? The result is the same on Acrobat 6 and 7.

I would appreciate it if somebody could help me!
Thanks in advance,

John


Attachments:

FillColor.pdf - contains a gray square - PDEPath with FILL COLOR, Pitstop shows the STROKE color is OFF
StrokeColor.pdf - contains a dark purple line - PDEPath with STROKE COLOR, Pitstop shows the FILL color is OFF
FIll_Stroke.pdf - contains the square and the line, objects are arranged in this order!
Stroke_Fill.pdf - contains the line and the square, objects are arranged in this order!


The source code is written in C++:
----------------------------------

void EnumObjects (PDEContent _content)
{
long numElems = PDEContentGetNumElems((PDEContent) _content);

for (ASInt32 i=0; i {
PDEElement pdeElement;
pdeElement = PDEContentGetElem((PDEContent)_content, i);

ASInt32 type = PDEObjectGetType((PDEObject)pdeElement);

ASAtom fillColorName = ASAtomNull;
ASAtom strokeColorName = ASAtomNull ;

switch (type)
{
case kPDEPath :
{
PDEGraphicState pdeGState;
PDEElementGetGState(pdeElement, &pdeGState, sizeof(PDEGraphicState));

fillColorName = PDEColorSpaceGetName((PDEColorSpace)pdeGState.fillColorSpec.space);
strokeColorName = PDEColorSpaceGetName((PDEColorSpace)pdeGState.strokeColorSpec.space);
const char* fillName = ASAtomGetString(fillColorName);
const char* strokeName = ASAtomGetString(strokeColorName);
char str[2000];
ASFixed *strokeVAL, *fillVAL;
fillVAL = (((pdeGState).fillColorSpec).value).color;
strokeVAL = (((pdeGState).strokeColorSpec).value).color;

sprintf(str, "Fill: %s [%d, %d, %d, %d, %d, %d] "
"\nStroke: %s [%d, %d, %d, %d, %d, %d]",
fillName, fillVAL[0], fillVAL[1], fillVAL[2], fillVAL[3], fillVAL[4], fillVAL[5],
strokeName, strokeVAL[0], strokeVAL[1], strokeVAL[2], strokeVAL[3], strokeVAL[4], strokeVAL[5]);
AVAlertNote(str);
}
break;
case kPDEForm :
EnumObjects ((PDEContent)pdeElement);
break;
default:
break;
}
}
}

static ACCB1 void ACCB2 DoAction(void*)
{
AVDoc theAVDoc = AVAppGetActiveDoc();
if(theAVDoc)
{
PDDoc thePDDoc = AVDocGetPDDoc(theAVDoc);

PDPage pdPage;
pdPage = PDDocAcquirePage(thePDDoc, 0);

PDEObject content;
content = (PDEObject)PDPageAcquirePDEContent(pdPage, gExtensionID);

EnumObjects ((PDEContent)content);
}
}



OUTPUT:
-------


FillColor.pdf

"Fill: Separation [65536, 0, 0, 0, 0, 0]
Stroke: DeviceGray [0, 0, 0, 0, 0, 0]" //this is the square

------

StrokeColor.pdf

"Fill: DeviceGray [0, 0, 0, 0, 0, 0]
Stroke: Separation [65536, 0, 0, 0, 0, 0]" //this is the line

------

FIll_Stroke.pdf

"Fill: Separation [65536, 0, 0, 0, 0, 0]
Stroke: DeviceGray [0, 0, 0, 0, 0, 0]" //this is the square

"Fill: Separation [65536, 0, 0, 0, 0, 0]
Stroke: Separation [65536, 0, 0, 0, 0, 0]" //??? this is the line, WHY IS THE FILL COLOR SEPARATION_65536 instead of DeviceGray 0 ???
// PitStop shows still as is expected
------

Stroke_Fill.pdf

"Fill: DeviceGray [0, 0, 0, 0, 0, 0]
Stroke: Separation [65536, 0, 0, 0, 0, 0]" //this is the line


"Fill: Separation [65536, 0, 0, 0, 0, 0]
Stroke: Separation [65536, 0, 0, 0, 0, 0]" //??? this is the square, WHY is the STROKE COLOR SEPARATION_65536 instead of DeviceGray 0 ???
//PitStop shows still as is expected

Click to open!FillColor.pdf
Gray square - Fill color (5,880 bytes)

Click to open!StrokeColor.pdf
Purple line - Stroke color (6,142 bytes)

Click to open!Fill_Stroke.pdf
Square and Line (6,212 bytes)

Click to open!Stroke_Fill.pdf
Line and Square (11,949 bytes)


PDF In-Depth Free Product Trials Ubiquitous PDF

Debenu Aerialist

The ultimate plug-in for Adobe Acrobat. Advanced splitting, merging, stamping, bookmarking, and link...

Download free demo

Debenu PDF Tools Pro

It's simple to use and will let you preview and edit PDF files, it's a Windows application that makes...

Download free demo

Back to the past, 15 years ago! Open Publish 2002

Looking back to 2002, it's amazing how much of the prediction became a reality. Take a read and see what you think!

September 14, 2017
Platinum Sponsor





Search Planet PDF
more searching options...
Planet PDF Newsletter
Most Popular Articles
Featured Product

Debenu PDF Aerialist

The ultimate plug-in for Adobe Acrobat. Advanced splitting, merging, stamping, bookmarking, and link control. Take Acrobat to the next level.

Features

Adding a PDF Stamp Comment

OK, so you want to stamp your document. Maybe you need to give reviewers some advice about the document's status or sensitivity. This tip from author Ted Padova demonstrates how to add stamps with the Stamp Tool along with related comments.