当前位置: 首页>>代码示例>>C++>>正文


C++ HPDF_PTRACE函数代码示例

本文整理汇总了C++中HPDF_PTRACE函数的典型用法代码示例。如果您正苦于以下问题:C++ HPDF_PTRACE函数的具体用法?C++ HPDF_PTRACE怎么用?C++ HPDF_PTRACE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了HPDF_PTRACE函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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_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

示例5: 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

示例6: 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

示例7: 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

示例8: 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

示例9: 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

示例10: 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

示例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


注:本文中的HPDF_PTRACE函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。