本文整理汇总了C++中HPDF_PTRACE函数的典型用法代码示例。如果您正苦于以下问题:C++ HPDF_PTRACE函数的具体用法?C++ HPDF_PTRACE怎么用?C++ HPDF_PTRACE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了HPDF_PTRACE函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: HPDF_Info_SetInfoAttr
HPDF_STATUS
HPDF_Info_SetInfoAttr (HPDF_Dict info,
HPDF_InfoType type,
const char *value,
HPDF_Encoder encoder)
{
const char* name = InfoTypeToName (type);
HPDF_PTRACE((" HPDF_Info_SetInfoAttr\n"));
if (type <= HPDF_INFO_MOD_DATE)
return HPDF_SetError (info->error, HPDF_INVALID_PARAMETER, 0);
if (type == HPDF_INFO_TRAPPED)
return HPDF_Dict_AddName(info, name, value);
return HPDF_Dict_Add (info, name, HPDF_String_New (info->mmgr, value,
encoder));
}
开发者ID:xharbour,项目名称:core,代码行数:19,代码来源:hpdf_info.c
示例2: HPDF_InsertPage
HPDF_InsertPage (HPDF_Doc pdf,
HPDF_Page target)
{
HPDF_Page page;
HPDF_STATUS ret;
HPDF_PTRACE ((" HPDF_InsertPage\n"));
if (!HPDF_HasDoc (pdf))
return NULL;
if (!HPDF_Page_Validate (target)) {
HPDF_RaiseError (&pdf->error, HPDF_INVALID_PAGE, 0);
return NULL;
}
/* check whether the page belong to the pdf */
if (pdf->mmgr != target->mmgr) {
HPDF_RaiseError (&pdf->error, HPDF_INVALID_PAGE, 0);
return NULL;
}
page = HPDF_Page_New (pdf->mmgr, pdf->xref);
if (!page) {
HPDF_CheckError (&pdf->error);
return NULL;
}
if ((ret = HPDF_Page_InsertBefore (page, target)) != HPDF_OK) {
HPDF_RaiseError (&pdf->error, ret, 0);
return NULL;
}
if ((ret = HPDF_List_Insert (pdf->page_list, target, page)) != HPDF_OK) {
HPDF_RaiseError (&pdf->error, ret, 0);
return NULL;
}
if (pdf->compression_mode & HPDF_COMP_TEXT)
HPDF_Page_SetFilter (page, HPDF_STREAM_FILTER_FLATE_DECODE);
return page;
}
开发者ID:GaryShearer,项目名称:BasicOCR,代码行数:43,代码来源:hpdf_doc.c
示例3: HPDF_SetOpenAction
HPDF_SetOpenAction (HPDF_Doc pdf,
HPDF_Destination open_action)
{
HPDF_STATUS ret;
HPDF_PTRACE ((" HPDF_SetOpenAction\n"));
if (!HPDF_HasDoc (pdf))
return HPDF_INVALID_DOCUMENT;
if (open_action && !HPDF_Destination_Validate (open_action))
return HPDF_RaiseError (&pdf->error, HPDF_INVALID_DESTINATION, 0);
ret = HPDF_Catalog_SetOpenAction (pdf->catalog, open_action);
if (ret != HPDF_OK)
return HPDF_CheckError (&pdf->error);
return HPDF_OK;
}
开发者ID:GaryShearer,项目名称:BasicOCR,代码行数:19,代码来源:hpdf_doc.c
示例4: HPDF_Info_GetInfoAttr
const char*
HPDF_Info_GetInfoAttr (HPDF_Dict info,
HPDF_InfoType type)
{
const char* name = InfoTypeToName (type);
HPDF_String s;
HPDF_PTRACE((" HPDF_Info_GetInfoAttr\n"));
if (!info)
return NULL;
s = (HPDF_String)HPDF_Dict_GetItem (info, name, HPDF_OCLASS_STRING);
if (!s)
return NULL;
else
return (const char *)(s->value);
}
开发者ID:xharbour,项目名称:core,代码行数:19,代码来源:hpdf_info.c
示例5: OnFree
static void
OnFree (HPDF_Dict obj)
{
HPDF_FontAttr attr = (HPDF_FontAttr)obj->attr;
HPDF_PTRACE ((" HPDF_TTFont_OnFree\n"));
if (attr) {
if (attr->widths) {
HPDF_FreeMem (obj->mmgr, attr->widths);
}
if (attr->used) {
HPDF_FreeMem (obj->mmgr, attr->used);
}
HPDF_FreeMem (obj->mmgr, attr);
}
}
开发者ID:xharbour,项目名称:core,代码行数:19,代码来源:hpdf_font_tt.c
示例6: OnWrite
static HPDF_STATUS
OnWrite (HPDF_Dict obj,
HPDF_Stream stream)
{
HPDF_FontAttr attr = (HPDF_FontAttr)obj->attr;
HPDF_BasicEncoderAttr encoder_attr =
(HPDF_BasicEncoderAttr)attr->encoder->attr;
HPDF_UINT i;
HPDF_STATUS ret;
char buf[128];
char *pbuf = buf;
char *eptr = buf + 127;
HPDF_PTRACE ((" HPDF_Font_OnWrite\n"));
/* Widths entry */
if ((ret = HPDF_Stream_WriteEscapeName (stream, "Widths")) != HPDF_OK)
return ret;
if ((ret = HPDF_Stream_WriteStr (stream, " [\012")) != HPDF_OK)
return ret;
for (i = encoder_attr->first_char; i <= encoder_attr->last_char; i++) {
pbuf = HPDF_IToA (pbuf, attr->widths[i], eptr);
*pbuf++ = ' ';
if ((i + 1) % 16 == 0) {
HPDF_StrCpy(pbuf, "\012", eptr);
if ((ret = HPDF_Stream_WriteStr (stream, buf)) != HPDF_OK)
return ret;
pbuf = buf;
}
}
HPDF_StrCpy (pbuf, "]\012", eptr);
if ((ret = HPDF_Stream_WriteStr (stream, buf)) != HPDF_OK)
return ret;
return attr->encoder->write_fn (attr->encoder, stream);
}
开发者ID:xharbour,项目名称:core,代码行数:43,代码来源:hpdf_font_tt.c
示例7: HPDF_Type1FontDef_SetWidths
HPDF_STATUS
HPDF_Type1FontDef_SetWidths (HPDF_FontDef fontdef,
const HPDF_CharData* widths)
{
const HPDF_CharData* src = widths;
HPDF_Type1FontDefAttr attr = (HPDF_Type1FontDefAttr)fontdef->attr;
HPDF_CharData* dst;
HPDF_UINT i = 0;
HPDF_PTRACE (" HPDF_Type1FontDef_SetWidths\n");
FreeWidth (fontdef);
while (src->unicode != 0xFFFF) {
src++;
i++;
}
attr->widths_count = i;
dst = (HPDF_CharData*)HPDF_GetMem (fontdef->mmgr, sizeof(HPDF_CharData) *
attr->widths_count);
if (dst == NULL)
return HPDF_Error_GetCode (fontdef->error);
HPDF_MemSet (dst, 0, sizeof(HPDF_CharData) * attr->widths_count);
attr->widths = dst;
src = widths;
for (i = 0; i < attr->widths_count; i++) {
dst->char_cd = src->char_cd;
dst->unicode = src->unicode;
dst->width = src->width;
if (dst->unicode == 0x0020) {
fontdef->missing_width = src->width;
}
src++;
dst++;
}
return HPDF_OK;
}
开发者ID:Elena-Andr,项目名称:libharu-android,代码行数:43,代码来源:hpdf_fontdef_type1.c
示例8: HPDF_Annot_SetGrayColor
HPDF_Annot_SetGrayColor (HPDF_Annotation annot, HPDF_REAL color)
{
HPDF_Array cArray;
HPDF_STATUS ret = HPDF_OK;
HPDF_PTRACE (" HPDF_Annot_SetGrayColor\n");
cArray = HPDF_Array_New (annot->mmgr);
if (!cArray)
return HPDF_Error_GetCode ( annot->error);
ret += HPDF_Dict_Add (annot, "C", cArray);
ret += HPDF_Array_AddReal ( cArray, color);
if (ret != HPDF_OK)
return HPDF_Error_GetCode ( annot->error);
return HPDF_OK;
}
开发者ID:draekko-rand,项目名称:libharu-android,代码行数:19,代码来源:hpdf_annotation.c
示例9: HPDF_Page_GetCurrentTextPos2
HPDF_Page_GetCurrentTextPos2 (HPDF_Page page,
HPDF_Point *pos)
{
HPDF_PageAttr attr;
HPDF_PTRACE((" HPDF_Page_GetCurrentTextPos2\n"));
pos->x = 0;
pos->y = 0;
if (!HPDF_Page_Validate (page))
return HPDF_INVALID_PAGE;
attr = (HPDF_PageAttr)page->attr;
if (attr->gmode & HPDF_GMODE_TEXT_OBJECT)
*pos = attr->text_pos;
return HPDF_OK;
}
开发者ID:elgatoboi,项目名称:fxpdf,代码行数:19,代码来源:hpdf_pages.c
示例10: HPDF_List_Remove
HPDF_STATUS
HPDF_List_Remove (HPDF_List list,
void *item)
{
HPDF_UINT i;
void **obj = list->obj;
HPDF_PTRACE((" HPDF_List_Remove\n"));
for (i = 0; i < list->count; i++) {
if (*obj == item) {
HPDF_List_RemoveByIndex(list, i);
return HPDF_OK;
} else
obj++;
}
return HPDF_ITEM_NOT_FOUND;
}
开发者ID:xharbour,项目名称:core,代码行数:19,代码来源:hpdf_list.c
示例11: HPDF_LinkAnnot_New
HPDF_Annotation
HPDF_LinkAnnot_New (HPDF_MMgr mmgr,
HPDF_Xref xref,
HPDF_Rect rect,
HPDF_Destination dst)
{
HPDF_Annotation annot;
HPDF_PTRACE((" HPDF_LinkAnnot_New\n"));
annot = HPDF_Annotation_New (mmgr, xref, HPDF_ANNOT_LINK, rect);
if (!annot)
return NULL;
if (HPDF_Dict_Add (annot, "Dest", dst) != HPDF_OK)
return NULL;
return annot;
}
开发者ID:cguagliano,项目名称:communitymodules,代码行数:19,代码来源:hpdf_annotation.c
示例12: HPDF_MarkupAnnot_SetInteriorGrayColor
HPDF_MarkupAnnot_SetInteriorGrayColor (HPDF_Annotation annot, HPDF_REAL color)/* IC with Gray entry */
{
HPDF_Array cArray;
HPDF_STATUS ret = HPDF_OK;
HPDF_PTRACE (" HPDF_MarkupAnnot_SetInteriorGrayColor\n");
cArray = HPDF_Array_New ( annot->mmgr);
if (!cArray)
return HPDF_Error_GetCode ( annot->error);
ret += HPDF_Dict_Add (annot, "IC", cArray);
ret += HPDF_Array_AddReal (cArray, color);
if (ret != HPDF_OK)
return HPDF_Error_GetCode ( annot->error);
return HPDF_OK;
}
开发者ID:draekko-rand,项目名称:libharu-android,代码行数:19,代码来源:hpdf_annotation.c
示例13: HPDF_PopupAnnot_New
HPDF_Annotation
HPDF_PopupAnnot_New (HPDF_MMgr mmgr,
HPDF_Xref xref,
HPDF_Rect rect,
HPDF_Annotation parent)
{
HPDF_Annotation annot;
HPDF_PTRACE (" HPDF_PopupAnnot_New\n");
annot = HPDF_Annotation_New (mmgr, xref, HPDF_ANNOT_POPUP, rect);
if (!annot)
return NULL;
if (HPDF_Dict_Add (annot, "Parent", parent) != HPDF_OK)
return NULL;
return annot;
}
开发者ID:draekko-rand,项目名称:libharu-android,代码行数:19,代码来源:hpdf_annotation.c
示例14: HPDF_NameDict_New
HPDF_NameDict
HPDF_NameDict_New (HPDF_MMgr mmgr,
HPDF_Xref xref)
{
HPDF_NameDict ndict;
HPDF_PTRACE((" HPDF_NameDict_New\n"));
ndict = HPDF_Dict_New (mmgr);
if (!ndict)
return NULL;
if (HPDF_Xref_Add (xref, ndict) != HPDF_OK)
return NULL;
ndict->header.obj_class |= HPDF_OSUBCLASS_NAMEDICT;
return ndict;
}
开发者ID:AMHF,项目名称:core,代码行数:19,代码来源:hpdfndic.c
示例15: HPDF_Doc_SetEncryptOff
HPDF_STATUS
HPDF_Doc_SetEncryptOff (HPDF_Doc pdf)
{
HPDF_PTRACE ((" HPDF_Doc_SetEncryptOff\n"));
if (!pdf->encrypt_on)
return HPDF_OK;
/* if encrypy-dict object is registered to cross-reference-table,
* replace it to null-object.
* additionally remove encrypt-dict object from trailer-object.
*/
if (pdf->encrypt_dict) {
HPDF_UINT obj_id = pdf->encrypt_dict->header.obj_id;
if (obj_id & HPDF_OTYPE_INDIRECT) {
HPDF_XrefEntry entry;
HPDF_Null null_obj;
HPDF_Dict_RemoveElement (pdf->trailer, "Encrypt");
entry = HPDF_Xref_GetEntryByObjectId (pdf->xref,
obj_id & 0x00FFFFFF);
if (!entry) {
return HPDF_SetError (&pdf->error,
HPDF_DOC_ENCRYPTDICT_NOT_FOUND, 0);
}
null_obj = HPDF_Null_New (pdf->mmgr);
if (!null_obj)
return pdf->error.error_no;
entry->obj = null_obj;
null_obj->header.obj_id = obj_id | HPDF_OTYPE_INDIRECT;
pdf->encrypt_dict->header.obj_id = HPDF_OTYPE_NONE;
}
}
pdf->encrypt_on = HPDF_FALSE;
return HPDF_OK;
}
开发者ID:GaryShearer,项目名称:BasicOCR,代码行数:43,代码来源:hpdf_doc.c
示例16: HPDF_LoadRawImageFromFile
HPDF_LoadRawImageFromFile (HPDF_Doc pdf,
const char *filename,
HPDF_UINT width,
HPDF_UINT height,
HPDF_ColorSpace color_space)
{
HPDF_Stream imagedata;
HPDF_Image image;
HPDF_PTRACE ((" HPDF_LoadRawImageFromFile\n"));
if (!HPDF_HasDoc (pdf))
return NULL;
/* create file stream */
imagedata = HPDF_FileReader_New (pdf->mmgr, filename);
if (HPDF_Stream_Validate (imagedata))
image = HPDF_Image_LoadRawImage (pdf->mmgr, imagedata, pdf->xref, width,
height, color_space);
else
image = NULL;
/* destroy file stream */
HPDF_Stream_Free (imagedata);
if (!image)
HPDF_CheckError (&pdf->error);
if (pdf->compression_mode & HPDF_COMP_IMAGE)
{
if (image != NULL)
image->filter = HPDF_STREAM_FILTER_FLATE_DECODE;
else
{
printf("Error. image is NULL.\n");
assert (0);
}
}
return image;
}
开发者ID:Federico2014,项目名称:edg4x-rose,代码行数:42,代码来源:hpdf_doc.c
示例17: HPDF_MarkupAnnot_SetCloudEffect
HPDF_MarkupAnnot_SetCloudEffect (HPDF_Annotation annot, HPDF_INT cloudIntensity) /* BE entry */
{
HPDF_Dict borderEffect;
HPDF_STATUS ret = HPDF_OK;
HPDF_PTRACE((" HPDF_MarkupAnnot_SetCloudEffect\n"));
borderEffect = HPDF_Dict_New ( annot->mmgr);
if (!borderEffect)
return HPDF_Error_GetCode ( annot->error);
ret += HPDF_Dict_Add ( annot, "BE", borderEffect);
ret += HPDF_Dict_AddName ( borderEffect, "S", "C");
ret += HPDF_Dict_AddNumber ( borderEffect, "I", cloudIntensity);
if (ret != HPDF_OK)
return HPDF_Error_GetCode (annot->error);
return HPDF_OK;
}
开发者ID:AlexShiLucky,项目名称:luapower-all,代码行数:20,代码来源:hpdf_annotation.c
示例18: HPDF_Array_Clear
void
HPDF_Array_Clear (HPDF_Array array)
{
HPDF_UINT i;
HPDF_PTRACE((" HPDF_Array_Clear\n"));
if (!array)
return;
for (i = 0; i < array->list->count; i++) {
void * obj = HPDF_List_ItemAt (array->list, i);
if (obj) {
HPDF_Obj_Free (array->mmgr, obj);
}
}
HPDF_List_Clear (array->list);
}
开发者ID:12307,项目名称:poco,代码行数:20,代码来源:hpdf_array.c
示例19: HPDF_CIDFontDef_FreeWidth
void
HPDF_CIDFontDef_FreeWidth (HPDF_FontDef fontdef)
{
HPDF_CIDFontDefAttr attr = (HPDF_CIDFontDefAttr)fontdef->attr;
HPDF_UINT i;
HPDF_PTRACE (" HPDF_FontDef_Validate\n");
for (i = 0; i < attr->widths->count; i++) {
HPDF_CID_Width *w =
(HPDF_CID_Width *)HPDF_List_ItemAt (attr->widths, i);
HPDF_FreeMem (fontdef->mmgr, w);
}
HPDF_List_Free (attr->widths);
attr->widths = NULL;
fontdef->valid = HPDF_FALSE;
}
开发者ID:Elena-Andr,项目名称:libharu-android,代码行数:20,代码来源:hpdf_fontdef_cid.c
示例20: HPDF_CIDFontDef_GetCIDWidth
HPDF_INT16
HPDF_CIDFontDef_GetCIDWidth (HPDF_FontDef fontdef,
HPDF_UINT16 cid)
{
HPDF_CIDFontDefAttr attr = (HPDF_CIDFontDefAttr)fontdef->attr;
HPDF_UINT i;
HPDF_PTRACE (" HPDF_CIDFontDef_GetCIDWidth\n");
for (i = 0; i < attr->widths->count; i++) {
HPDF_CID_Width *w = (HPDF_CID_Width *)HPDF_List_ItemAt (attr->widths,
i);
if (w->cid == cid)
return w->width;
}
/* Not found in pdf_cid_width array. */
return attr->DW;
}
开发者ID:Elena-Andr,项目名称:libharu-android,代码行数:20,代码来源:hpdf_fontdef_cid.c
注:本文中的HPDF_PTRACE函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论