📄 pdflib.cpp
字号:
BitReverse, K, BlackIs1);
}
PDFCPP_CATCH;
return retval;
}
int
PDFlib::open_file(string filename) throw(PDFlib::Exception)
{
int retval = 0;
PDFCPP_TRY retval = m_PDFlib_api->PDF_open_file(p, CHAR(filename));
PDFCPP_CATCH;
return retval;
}
int
PDFlib::open_image(string imagetype, string source, const char *data, long len,
int width, int height, int components, int bpc, string params)
throw(PDFlib::Exception)
{
int retval = 0;
PDFCPP_TRY
{
retval = m_PDFlib_api->PDF_open_image(p, CHAR(imagetype), CHAR(source),
data, len, width, height, components, bpc, CHAR(params));
}
PDFCPP_CATCH;
return retval;
}
int
PDFlib::open_image_file(string imagetype, string filename,
string stringparam, int intparam) throw(PDFlib::Exception)
{
int retval = 0;
PDFCPP_TRY
{
retval = m_PDFlib_api->PDF_open_image_file(p, CHAR(imagetype),
CHAR(filename), CHAR(stringparam), intparam);
}
PDFCPP_CATCH;
return retval;
}
void
PDFlib::open_mem(writeproc_t writeproc) throw(PDFlib::Exception)
{
PDFCPP_TRY m_PDFlib_api->PDF_open_mem(p, writeproc);
PDFCPP_CATCH;
}
int
PDFlib::open_pdi(string filename, string optlist, int reserved)
throw(PDFlib::Exception)
{
int retval = 0;
PDFCPP_TRY
retval = m_PDFlib_api->PDF_open_pdi(p, CHAR(filename),
CHAR(optlist), reserved);
PDFCPP_CATCH;
return retval;
}
int
PDFlib::open_pdi_page(int doc, int pagenumber, string optlist)
throw(PDFlib::Exception)
{
int retval = 0;
PDFCPP_TRY
retval = m_PDFlib_api->PDF_open_pdi_page(p, doc, pagenumber,
CHAR(optlist));
PDFCPP_CATCH;
return retval;
}
void
PDFlib::place_image(int image, double x, double y, double p_scale)
throw(PDFlib::Exception)
{
PDFCPP_TRY m_PDFlib_api->PDF_place_image(p, image, x, y, p_scale);
PDFCPP_CATCH;
}
void
PDFlib::place_pdi_page(int page, double x, double y, double sx, double sy)
throw(PDFlib::Exception)
{
PDFCPP_TRY m_PDFlib_api->PDF_place_pdi_page(p, page, x, y, sx, sy);
PDFCPP_CATCH;
}
int
PDFlib::process_pdi(int doc, int page, string optlist)
throw(PDFlib::Exception)
{
int retval = 0;
PDFCPP_TRY
retval = m_PDFlib_api->PDF_process_pdi(p, doc, page, CHAR(optlist));
PDFCPP_CATCH;
return retval;
}
void
PDFlib::rect(double x, double y, double width, double height)
throw(PDFlib::Exception)
{
PDFCPP_TRY m_PDFlib_api->PDF_rect(p, x, y, width, height);
PDFCPP_CATCH;
}
void
PDFlib::restore() throw(PDFlib::Exception)
{
PDFCPP_TRY m_PDFlib_api->PDF_restore(p);
PDFCPP_CATCH;
}
void
PDFlib::resume_page(string optlist)
throw(PDFlib::Exception)
{
PDFCPP_TRY
m_PDFlib_api->PDF_resume_page(p, CHAR(optlist));
PDFCPP_CATCH;
}
void
PDFlib::rotate(double phi) throw(PDFlib::Exception)
{
PDFCPP_TRY m_PDFlib_api->PDF_rotate(p, phi);
PDFCPP_CATCH;
}
void
PDFlib::save() throw(PDFlib::Exception)
{
PDFCPP_TRY m_PDFlib_api->PDF_save(p);
PDFCPP_CATCH;
}
void
PDFlib::scale(double sx, double sy) throw(PDFlib::Exception)
{
PDFCPP_TRY m_PDFlib_api->PDF_scale(p, sx, sy);
PDFCPP_CATCH;
}
void
PDFlib::set_border_color(double red, double green, double blue)
throw(PDFlib::Exception)
{
PDFCPP_TRY m_PDFlib_api->PDF_set_border_color(p, red, green, blue);
PDFCPP_CATCH;
}
void
PDFlib::set_border_dash(double b, double w) throw(PDFlib::Exception)
{
PDFCPP_TRY m_PDFlib_api->PDF_set_border_dash(p, b, w);
PDFCPP_CATCH;
}
void
PDFlib::set_border_style(string style, double width) throw(PDFlib::Exception)
{
PDFCPP_TRY m_PDFlib_api->PDF_set_border_style(p, CHAR(style), width);
PDFCPP_CATCH;
}
void
PDFlib::setfont(int font, double fontsize) throw(PDFlib::Exception)
{
PDFCPP_TRY m_PDFlib_api->PDF_setfont(p, font, fontsize);
PDFCPP_CATCH;
}
void
PDFlib::set_gstate(int gstate)
throw(PDFlib::Exception)
{
PDFCPP_TRY m_PDFlib_api->PDF_set_gstate(p, gstate);
PDFCPP_CATCH;
}
void
PDFlib::set_info(string key, string value) throw(PDFlib::Exception)
{
PDFCPP_TRY
m_PDFlib_api->PDF_set_info2(p, CHAR(key), CHAR(value),
(int) LEN(value));
PDFCPP_CATCH;
}
void
PDFlib::set_layer_dependency(string type, string optlist)
throw(PDFlib::Exception)
{
PDFCPP_TRY
m_PDFlib_api->PDF_set_layer_dependency(p, CHAR(type), CHAR(optlist));
PDFCPP_CATCH;
}
void
PDFlib::set_parameter(string key, string value) throw(PDFlib::Exception)
{
PDFCPP_TRY m_PDFlib_api->PDF_set_parameter(p, CHAR(key), CHAR(value));
PDFCPP_CATCH;
}
void
PDFlib::set_text_pos(double x, double y) throw(PDFlib::Exception)
{
PDFCPP_TRY m_PDFlib_api->PDF_set_text_pos(p, x, y);
PDFCPP_CATCH;
}
void
PDFlib::set_value(string key, double value) throw(PDFlib::Exception)
{
PDFCPP_TRY m_PDFlib_api->PDF_set_value(p, CHAR(key), value);
PDFCPP_CATCH;
}
void
PDFlib::setcolor(string fstype, string colorspace,
double c1, double c2, double c3, double c4) throw(PDFlib::Exception)
{
PDFCPP_TRY
m_PDFlib_api->PDF_setcolor(p, CHAR(fstype), CHAR(colorspace), c1, c2,
c3, c4);
PDFCPP_CATCH;
}
void
PDFlib::setdash(double b, double w) throw(PDFlib::Exception)
{
PDFCPP_TRY m_PDFlib_api->PDF_setdash(p, b, w);
PDFCPP_CATCH;
}
void
PDFlib::setdashpattern(string optlist) throw(PDFlib::Exception)
{
PDFCPP_TRY m_PDFlib_api->PDF_setdashpattern(p, CHAR(optlist));
PDFCPP_CATCH;
}
void
PDFlib::setflat(double flatness) throw(PDFlib::Exception)
{
PDFCPP_TRY m_PDFlib_api->PDF_setflat(p, flatness);
PDFCPP_CATCH;
}
void
PDFlib::setlinecap(int linecap) throw(PDFlib::Exception)
{
PDFCPP_TRY m_PDFlib_api->PDF_setlinecap(p, linecap);
PDFCPP_CATCH;
}
void
PDFlib::setlinejoin(int linejoin) throw(PDFlib::Exception)
{
PDFCPP_TRY m_PDFlib_api->PDF_setlinejoin(p, linejoin);
PDFCPP_CATCH;
}
void
PDFlib::setlinewidth(double width) throw(PDFlib::Exception)
{
PDFCPP_TRY m_PDFlib_api->PDF_setlinewidth(p, width);
PDFCPP_CATCH;
}
void
PDFlib::setmatrix( double a, double b, double c, double d, double e, double f)
throw(PDFlib::Exception)
{
PDFCPP_TRY m_PDFlib_api->PDF_setmatrix(p, a, b, c, d, e, f);
PDFCPP_CATCH;
}
void
PDFlib::setmiterlimit(double miter) throw(PDFlib::Exception)
{
PDFCPP_TRY m_PDFlib_api->PDF_setmiterlimit(p, miter);
PDFCPP_CATCH;
}
void
PDFlib::setpolydash(float *darray, int length) throw(PDFlib::Exception)
{
PDFCPP_TRY m_PDFlib_api->PDF_setpolydash(p, darray, length);
PDFCPP_CATCH;
}
int
PDFlib::shading (string shtype, double x0, double y0, double x1, double y1,
double c1, double c2, double c3, double c4, string optlist)
throw(PDFlib::Exception)
{
int retval = 0;
PDFCPP_TRY
retval = m_PDFlib_api->PDF_shading(p, CHAR(shtype), x0, y0, x1, y1,
c1, c2, c3, c4, CHAR(optlist));
PDFCPP_CATCH;
return retval;
}
int
PDFlib::shading_pattern (int shade, string optlist) throw(PDFlib::Exception)
{
int retval = 0;
PDFCPP_TRY
retval = m_PDFlib_api->PDF_shading_pattern(p, shade, CHAR(optlist));
PDFCPP_CATCH;
return retval;
}
void
PDFlib::shfill (int shade) throw(PDFlib::Exception)
{
PDFCPP_TRY
m_PDFlib_api->PDF_shfill(p, shade);
PDFCPP_CATCH;
}
void
PDFlib::show(string text) throw(PDFlib::Exception)
{
PDFCPP_TRY m_PDFlib_api->PDF_show2(p, CHAR(text), (int) LEN(text));
PDFCPP_CATCH;
}
int
PDFlib::show_boxed(string text, double left, double top,
double width, double height, string hmode, string feature)
throw(PDFlib::Exception)
{
int retval = 0;
PDFCPP_TRY
retval = m_PDFlib_api->PDF_show_boxed(p, CHAR(text), left, top, width,
height, CHAR(hmode), CHAR(feature));
PDFCPP_CATCH;
return retval;
}
void
PDFlib::show_xy(string text, double x, double y) throw(PDFlib::Exception)
{
PDFCPP_TRY
m_PDFlib_api->PDF_show_xy2(p, CHAR(text), (int) LEN(text), x, y);
PDFCPP_CATCH;
}
void
PDFlib::skew(double alpha, double beta) throw(PDFlib::Exception)
{
PDFCPP_TRY m_PDFlib_api->PDF_skew(p, alpha, beta);
PDFCPP_CATCH;
}
double
PDFlib::stringwidth(string text, int font, double fontsize)
throw(PDFlib::Exception)
{
double retval = 0;
PDFCPP_TRY
retval = m_PDFlib_api->PDF_stringwidth2(p, CHAR(text),
(int) LEN(text), font, fontsize);
PDFCPP_CATCH;
return retval;
}
void
PDFlib::stroke() throw(PDFlib::Exception)
{
PDFCPP_TRY m_PDFlib_api->PDF_stroke(p);
PDFCPP_CATCH;
}
void
PDFlib::suspend_page(string optlist)
throw(PDFlib::Exception)
{
PDFCPP_TRY
m_PDFlib_api->PDF_suspend_page(p, CHAR(optlist));
PDFCPP_CATCH;
}
void
PDFlib::translate(double tx, double ty) throw(PDFlib::Exception)
{
PDFCPP_TRY m_PDFlib_api->PDF_translate(p, tx, ty);
PDFCPP_CATCH;
}
string
PDFlib::utf16_to_utf8(string utf16string) throw(PDFlib::Exception)
{
const char *retval = NULL;
PDFCPP_TRY
{
retval = m_PDFlib_api->PDF_utf16_to_utf8(p, CHAR(utf16string),
(int) LEN(utf16string), NULL);
}
PDFCPP_CATCH;
if (retval)
return retval;
else
return "";
}
string
PDFlib::utf8_to_utf16(string utf8string, string format) throw(PDFlib::Exception)
{
const char *retval = NULL;
PDFCPP_TRY
{
retval = m_PDFlib_api->PDF_utf8_to_utf16(p, CHAR(utf8string),
CHAR(format), NULL);
}
PDFCPP_CATCH;
if (retval)
return retval;
else
return "";
}
void
PDFlib::xshow(string text, const double *xadvancelist) throw(PDFlib::Exception)
{
PDFCPP_TRY m_PDFlib_api->PDF_xshow(p, CHAR(text), (int) LEN(text),
xadvancelist);
PDFCPP_CATCH;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -