本文整理汇总了C++中PDF_NAME函数的典型用法代码示例。如果您正苦于以下问题:C++ PDF_NAME函数的具体用法?C++ PDF_NAME怎么用?C++ PDF_NAME使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PDF_NAME函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: pdf_set_annot_is_open
void
pdf_set_annot_is_open(fz_context *ctx, pdf_annot *annot, int is_open)
{
check_allowed_subtypes(ctx, annot, PDF_NAME(Open), open_subtypes);
pdf_dict_put_bool(ctx, annot->obj, PDF_NAME(Open), is_open);
pdf_dirty_annot(ctx, annot);
}
开发者ID:muennich,项目名称:mupdf,代码行数:7,代码来源:pdf-annot-edit.c
示例2: pdf_set_annot_vertices
void
pdf_set_annot_vertices(fz_context *ctx, pdf_annot *annot, int n, const fz_point *v)
{
pdf_document *doc = annot->page->doc;
fz_matrix page_ctm, inv_page_ctm;
pdf_obj *vertices;
fz_point point;
int i;
check_allowed_subtypes(ctx, annot, PDF_NAME(Vertices), vertices_subtypes);
if (n <= 0 || !v)
fz_throw(ctx, FZ_ERROR_GENERIC, "invalid number of vertices");
pdf_page_transform(ctx, annot->page, NULL, &page_ctm);
fz_invert_matrix(&inv_page_ctm, &page_ctm);
vertices = pdf_new_array(ctx, doc, n * 2);
for (i = 0; i < n; ++i)
{
point = v[i];
fz_transform_point(&point, &inv_page_ctm);
pdf_array_push_real(ctx, vertices, point.x);
pdf_array_push_real(ctx, vertices, point.y);
}
pdf_dict_put_drop(ctx, annot->obj, PDF_NAME(Vertices), vertices);
pdf_dirty_annot(ctx, annot);
}
开发者ID:muennich,项目名称:mupdf,代码行数:27,代码来源:pdf-annot-edit.c
示例3: pdf_set_annot_icon_name
void
pdf_set_annot_icon_name(fz_context *ctx, pdf_annot *annot, const char *name)
{
check_allowed_subtypes(ctx, annot, PDF_NAME(Name), icon_name_subtypes);
pdf_dict_put_name(ctx, annot->obj, PDF_NAME(Name), name);
pdf_dirty_annot(ctx, annot);
}
开发者ID:muennich,项目名称:mupdf,代码行数:7,代码来源:pdf-annot-edit.c
示例4: pdf_set_annot_quad_points
void
pdf_set_annot_quad_points(fz_context *ctx, pdf_annot *annot, int n, const float *v)
{
pdf_document *doc = annot->page->doc;
fz_matrix page_ctm, inv_page_ctm;
pdf_obj *quad_points;
fz_point point;
int i, k;
check_allowed_subtypes(ctx, annot, PDF_NAME(QuadPoints), quad_point_subtypes);
if (n <= 0 || !v)
fz_throw(ctx, FZ_ERROR_GENERIC, "invalid number of quadrilaterals");
pdf_page_transform(ctx, annot->page, NULL, &page_ctm);
fz_invert_matrix(&inv_page_ctm, &page_ctm);
quad_points = pdf_new_array(ctx, doc, n * 8);
for (i = 0; i < n; ++i)
{
for (k = 0; k < 4; ++k)
{
point.x = v[i * 8 + k * 2 + 0];
point.y = v[i * 8 + k * 2 + 1];
fz_transform_point(&point, &inv_page_ctm);
pdf_array_push_real(ctx, quad_points, point.x);
pdf_array_push_real(ctx, quad_points, point.y);
}
}
pdf_dict_put_drop(ctx, annot->obj, PDF_NAME(QuadPoints), quad_points);
pdf_dirty_annot(ctx, annot);
}
开发者ID:muennich,项目名称:mupdf,代码行数:31,代码来源:pdf-annot-edit.c
示例5: pdf_set_annot_author
void
pdf_set_annot_author(fz_context *ctx, pdf_annot *annot, const char *author)
{
check_allowed_subtypes(ctx, annot, PDF_NAME(T), markup_subtypes);
pdf_dict_put_text_string(ctx, annot->obj, PDF_NAME(T), author);
pdf_dirty_annot(ctx, annot);
}
开发者ID:muennich,项目名称:mupdf,代码行数:7,代码来源:pdf-annot-edit.c
示例6: pdf_set_annot_ink_list
void
pdf_set_annot_ink_list(fz_context *ctx, pdf_annot *annot, int n, const int *count, const fz_point *v)
{
pdf_document *doc = annot->page->doc;
fz_matrix page_ctm, inv_page_ctm;
pdf_obj *ink_list, *stroke;
fz_point point;
int i, k;
check_allowed_subtypes(ctx, annot, PDF_NAME(InkList), ink_list_subtypes);
pdf_page_transform(ctx, annot->page, NULL, &page_ctm);
fz_invert_matrix(&inv_page_ctm, &page_ctm);
// TODO: update Rect (in update appearance perhaps?)
ink_list = pdf_new_array(ctx, doc, n);
for (i = 0; i < n; ++i)
{
stroke = pdf_new_array(ctx, doc, count[i] * 2);
for (k = 0; k < count[i]; ++k)
{
point = *v++;
fz_transform_point(&point, &inv_page_ctm);
pdf_array_push_real(ctx, stroke, point.x);
pdf_array_push_real(ctx, stroke, point.y);
}
pdf_array_push_drop(ctx, ink_list, stroke);
}
pdf_dict_put_drop(ctx, annot->obj, PDF_NAME(InkList), ink_list);
pdf_dirty_annot(ctx, annot);
}
开发者ID:muennich,项目名称:mupdf,代码行数:32,代码来源:pdf-annot-edit.c
示例7: pdf_xobject_knockout
int pdf_xobject_knockout(fz_context *ctx, pdf_obj *xobj)
{
pdf_obj *group = pdf_dict_get(ctx, xobj, PDF_NAME(Group));
if (group)
return pdf_dict_get_bool(ctx, group, PDF_NAME(K));
return 0;
}
开发者ID:JorjMcKie,项目名称:mupdf,代码行数:7,代码来源:pdf-xobject.c
示例8: pdf_clear_annot_quad_points
void
pdf_clear_annot_quad_points(fz_context *ctx, pdf_annot *annot)
{
check_allowed_subtypes(ctx, annot, PDF_NAME(QuadPoints), quad_point_subtypes);
pdf_dict_del(ctx, annot->obj, PDF_NAME(QuadPoints));
pdf_dirty_annot(ctx, annot);
}
开发者ID:muennich,项目名称:mupdf,代码行数:7,代码来源:pdf-annot-edit.c
示例9: pdf_xobject_isolated
int pdf_xobject_isolated(fz_context *ctx, pdf_obj *xobj)
{
pdf_obj *group = pdf_dict_get(ctx, xobj, PDF_NAME(Group));
if (group)
return pdf_dict_get_bool(ctx, group, PDF_NAME(I));
return 0;
}
开发者ID:JorjMcKie,项目名称:mupdf,代码行数:7,代码来源:pdf-xobject.c
示例10: pdf_add_annot_quad_point
void
pdf_add_annot_quad_point(fz_context *ctx, pdf_annot *annot, fz_rect bbox)
{
pdf_document *doc = annot->page->doc;
fz_matrix page_ctm, inv_page_ctm;
pdf_obj *quad_points;
check_allowed_subtypes(ctx, annot, PDF_NAME(QuadPoints), quad_point_subtypes);
pdf_page_transform(ctx, annot->page, NULL, &page_ctm);
fz_invert_matrix(&inv_page_ctm, &page_ctm);
quad_points = pdf_dict_get(ctx, annot->obj, PDF_NAME(QuadPoints));
if (!pdf_is_array(ctx, quad_points))
{
quad_points = pdf_new_array(ctx, doc, 8);
pdf_dict_put_drop(ctx, annot->obj, PDF_NAME(QuadPoints), quad_points);
}
/* Contrary to the specification, the points within a QuadPoint are NOT ordered
* in a counterclockwise fashion. Experiments with Adobe's implementation
* indicates a cross-wise ordering is intended: ul, ur, ll, lr.
*/
fz_transform_rect(&bbox, &inv_page_ctm);
pdf_array_push_real(ctx, quad_points, bbox.x0); /* ul */
pdf_array_push_real(ctx, quad_points, bbox.y1);
pdf_array_push_real(ctx, quad_points, bbox.x1); /* ur */
pdf_array_push_real(ctx, quad_points, bbox.y1);
pdf_array_push_real(ctx, quad_points, bbox.x0); /* ll */
pdf_array_push_real(ctx, quad_points, bbox.y0);
pdf_array_push_real(ctx, quad_points, bbox.x1); /* lr */
pdf_array_push_real(ctx, quad_points, bbox.y0);
pdf_dirty_annot(ctx, annot);
}
开发者ID:muennich,项目名称:mupdf,代码行数:35,代码来源:pdf-annot-edit.c
示例11: pdf_load_linear_shading
static void
pdf_load_linear_shading(fz_context *ctx, pdf_document *doc, fz_shade *shade, pdf_obj *dict, int funcs, pdf_function **func)
{
pdf_obj *obj;
float d0, d1;
int e0, e1;
obj = pdf_dict_get(ctx, dict, PDF_NAME(Coords));
shade->u.l_or_r.coords[0][0] = pdf_array_get_real(ctx, obj, 0);
shade->u.l_or_r.coords[0][1] = pdf_array_get_real(ctx, obj, 1);
shade->u.l_or_r.coords[1][0] = pdf_array_get_real(ctx, obj, 2);
shade->u.l_or_r.coords[1][1] = pdf_array_get_real(ctx, obj, 3);
d0 = 0;
d1 = 1;
obj = pdf_dict_get(ctx, dict, PDF_NAME(Domain));
if (obj)
{
d0 = pdf_array_get_real(ctx, obj, 0);
d1 = pdf_array_get_real(ctx, obj, 1);
}
e0 = e1 = 0;
obj = pdf_dict_get(ctx, dict, PDF_NAME(Extend));
if (obj)
{
e0 = pdf_array_get_bool(ctx, obj, 0);
e1 = pdf_array_get_bool(ctx, obj, 1);
}
pdf_sample_shade_function(ctx, shade, funcs, func, d0, d1);
shade->u.l_or_r.extend[0] = e0;
shade->u.l_or_r.extend[1] = e1;
}
开发者ID:muennich,项目名称:mupdf,代码行数:35,代码来源:pdf-shade.c
示例12: pdf_clear_annot_ink_list
void
pdf_clear_annot_ink_list(fz_context *ctx, pdf_annot *annot)
{
check_allowed_subtypes(ctx, annot, PDF_NAME(InkList), ink_list_subtypes);
pdf_dict_del(ctx, annot->obj, PDF_NAME(InkList));
pdf_dirty_annot(ctx, annot);
}
开发者ID:muennich,项目名称:mupdf,代码行数:7,代码来源:pdf-annot-edit.c
示例13: pdf_annot_quad_point_count
int
pdf_annot_quad_point_count(fz_context *ctx, pdf_annot *annot)
{
pdf_obj *quad_points;
check_allowed_subtypes(ctx, annot, PDF_NAME(QuadPoints), quad_point_subtypes);
quad_points = pdf_dict_get(ctx, annot->obj, PDF_NAME(QuadPoints));
return pdf_array_len(ctx, quad_points) / 8;
}
开发者ID:muennich,项目名称:mupdf,代码行数:8,代码来源:pdf-annot-edit.c
示例14: pdf_set_annot_opacity
void pdf_set_annot_opacity(fz_context *ctx, pdf_annot *annot, float opacity)
{
if (opacity != 1)
pdf_dict_put_real(ctx, annot->obj, PDF_NAME(CA), opacity);
else
pdf_dict_del(ctx, annot->obj, PDF_NAME(CA));
pdf_dirty_annot(ctx, annot);
}
开发者ID:muennich,项目名称:mupdf,代码行数:8,代码来源:pdf-annot-edit.c
示例15: pdf_xobject_transparency
int pdf_xobject_transparency(fz_context *ctx, pdf_obj *xobj)
{
pdf_obj *group = pdf_dict_get(ctx, xobj, PDF_NAME(Group));
if (group)
if (pdf_name_eq(ctx, pdf_dict_get(ctx, group, PDF_NAME(S)), PDF_NAME(Transparency)))
return 1;
return 0;
}
开发者ID:JorjMcKie,项目名称:mupdf,代码行数:8,代码来源:pdf-xobject.c
示例16: pdf_annot_vertex_count
int
pdf_annot_vertex_count(fz_context *ctx, pdf_annot *annot)
{
pdf_obj *vertices;
check_allowed_subtypes(ctx, annot, PDF_NAME(Vertices), vertices_subtypes);
vertices = pdf_dict_get(ctx, annot->obj, PDF_NAME(Vertices));
return pdf_array_len(ctx, vertices) / 2;
}
开发者ID:muennich,项目名称:mupdf,代码行数:8,代码来源:pdf-annot-edit.c
示例17: pdf_annot_ink_list_count
int
pdf_annot_ink_list_count(fz_context *ctx, pdf_annot *annot)
{
pdf_obj *ink_list;
check_allowed_subtypes(ctx, annot, PDF_NAME(InkList), ink_list_subtypes);
ink_list = pdf_dict_get(ctx, annot->obj, PDF_NAME(InkList));
return pdf_array_len(ctx, ink_list);
}
开发者ID:muennich,项目名称:mupdf,代码行数:8,代码来源:pdf-annot-edit.c
示例18: pdf_clean_stream_object
static void
pdf_clean_stream_object(fz_context *ctx, pdf_document *doc, pdf_obj *obj, pdf_obj *orig_res, fz_cookie *cookie, int own_res,
pdf_text_filter_fn *text_filter, pdf_after_text_object_fn *after_text, void *arg,
int sanitize, int ascii)
{
pdf_processor *proc_buffer = NULL;
pdf_processor *proc_filter = NULL;
pdf_obj *res = NULL;
pdf_obj *ref;
fz_buffer *buffer;
if (!obj)
return;
fz_var(res);
fz_var(proc_buffer);
fz_var(proc_filter);
buffer = fz_new_buffer(ctx, 1024);
fz_try(ctx)
{
if (own_res)
{
pdf_obj *r = pdf_dict_get(ctx, obj, PDF_NAME(Resources));
if (r)
orig_res = r;
}
res = pdf_new_dict(ctx, doc, 1);
proc_buffer = pdf_new_buffer_processor(ctx, buffer, ascii);
proc_filter = pdf_new_filter_processor_with_text_filter(ctx, doc, proc_buffer, orig_res, res, text_filter, after_text, arg);
pdf_process_contents(ctx, proc_filter, doc, orig_res, obj, cookie);
pdf_close_processor(ctx, proc_filter);
pdf_close_processor(ctx, proc_buffer);
pdf_update_stream(ctx, doc, obj, buffer, 0);
if (own_res)
{
ref = pdf_add_object(ctx, doc, res);
pdf_dict_put_drop(ctx, obj, PDF_NAME(Resources), ref);
}
}
fz_always(ctx)
{
pdf_drop_processor(ctx, proc_filter);
pdf_drop_processor(ctx, proc_buffer);
fz_drop_buffer(ctx, buffer);
pdf_drop_obj(ctx, res);
}
fz_catch(ctx)
{
fz_rethrow(ctx);
}
}
开发者ID:JorjMcKie,项目名称:mupdf,代码行数:58,代码来源:pdf-clean.c
示例19: pdf_set_annot_border
void
pdf_set_annot_border(fz_context *ctx, pdf_annot *annot, float w)
{
pdf_obj *bs = pdf_dict_get(ctx, annot->obj, PDF_NAME(BS));
if (!pdf_is_dict(ctx, bs))
bs = pdf_dict_put_dict(ctx, annot->obj, PDF_NAME(BS), 1);
pdf_dict_put_real(ctx, bs, PDF_NAME(W), w);
pdf_dirty_annot(ctx, annot);
}
开发者ID:muennich,项目名称:mupdf,代码行数:9,代码来源:pdf-annot-edit.c
示例20: pdf_annot_ink_list_stroke_count
int
pdf_annot_ink_list_stroke_count(fz_context *ctx, pdf_annot *annot, int i)
{
pdf_obj *ink_list;
pdf_obj *stroke;
check_allowed_subtypes(ctx, annot, PDF_NAME(InkList), ink_list_subtypes);
ink_list = pdf_dict_get(ctx, annot->obj, PDF_NAME(InkList));
stroke = pdf_array_get(ctx, ink_list, i);
return pdf_array_len(ctx, stroke) / 2;
}
开发者ID:muennich,项目名称:mupdf,代码行数:10,代码来源:pdf-annot-edit.c
注:本文中的PDF_NAME函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论