VintaSoft PDF .NET Plug-in Discussions
Questions, comments and suggestions concerning VintaSoft PDF .NET Plug-in.
Board index < VintaSoft Imaging < VintaSoft PDF .NET Plug-in Discussions
PDPage page = PDDocAcquirePage(doc, pageNumber);
PDEContent pdeContent = PDPageAcquirePDEContent(page, gExtensionID);
PDEPath path = createPageBolderPath(page, bolderWidth, bolderColor);
PDEContentAddElem(pdeContent, kPDEAfterLast, (PDEElement)path);
PDPageSetPDEContent(page, gExtensionID);
PDERelease((PDEObject)path);
PDPageReleasePDEContent(page, gExtensionID);
PDEPath JxStatusSetAction::createPageBolderPath(PDPage page, int width, QColor color) {
PDEPath path = PDEPathCreate();
ASFixedRect cropBox;
PDPageGetCropBox(page, &cropBox);
PDEPathSetPaintOp(path, kPDEStroke);
PDEGraphicState state;
memset(&state, 0, sizeof(PDEGraphicState));
state.strokeColorSpec.space = PDEColorSpaceCreateFromName(ASAtomFromString("DeviceRGB"));
state.strokeColorSpec.value.color[0] = ASFloatToFixed(color.redF());
state.strokeColorSpec.value.color[1] = ASFloatToFixed(color.greenF());
state.strokeColorSpec.value.color[2] = ASFloatToFixed(color.blueF());
state.lineWidth = ASInt16ToFixed(width);
state.miterLimit = fixedTen;
state.flatness = fixedOne;
PDEElementSetGState((PDEElement)path, &state, sizeof(PDEGraphicState));
ASFixed pathData[5];
pathData[0] = kPDERect;
pathData[1] = cropBox.left;
pathData[2] = cropBox.top;
pathData[3] = cropBox.right - cropBox.left;
pathData[4] = cropBox.bottom - cropBox.top;
PDEPathSetData(path, pathData, sizeof(pathData));
return path;
}
This is the second one (Reset status)
PDPage page = PDDocAcquirePage(doc, pageNumber);
// delete all last elements which are path. for old pdflyer it might has two paths
PDEContent pdeContent = PDPageAcquirePDEContent(page, gExtensionID);
while (true) {
int pdeNumber = PDEContentGetNumElems(pdeContent);
if (pdeNumber == 0) break;
PDEElement element = PDEContentGetElem (pdeContent, pdeNumber - 1);
if (PDEObjectGetType((PDEObject)element) != kPDEPath) break;
PDEContentRemoveElem(pdeContent, pdeNumber - 1);
}
PDPageSetPDEContent(page, gExtensionID);
PDPageReleasePDEContent(page, gExtensionID);
PDPageRelease(page);
Someone could you help me to convert it ?