wostringstream optlist;
    optlist.str(L"");

    PDFlib p;
    p.set_option(L"errorpolicy=return");
    p.set_option(optlist.str());

    if (p.begin_document(L"font.pdf", L"") == -1) {
        return;
    }
    p.set_info(L"Creator", L"PDFlib starter sample");
    p.set_info(L"Title", L"test");
    int font = p.load_font(L"Helvetica-Bold", L"host", L"");
    if (font == -1) {
        wcerr << p.get_errmsg();
        return;
    }
    p.begin_page_ext(a4_width, a4_height, L"");
    p.setfont(font, 12);
    p.set_text_pos(50, 700);
    //写入文字方法1
    p.show(L"Hello, world!");
    //写入文字方法二
    p.continue_text(L"C++");
    p.end_page_ext(L"");

    p.end_document(L"");

c++ pdflib 生成文本

 

相关文章:

  • 2022-12-23
  • 2021-12-28
  • 2021-10-31
  • 2022-01-10
  • 2021-11-09
  • 2021-05-19
猜你喜欢
  • 2021-12-03
  • 2021-09-08
  • 2022-12-23
  • 2022-12-23
  • 2021-12-06
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案