2

PDFLibエンジンを使用してpdfファイルを生成しています。テンプレート機能を使用しましたが、コードは次のとおりです。

/* define the template */
template = p.begin_template_ext(width, height, "");

...template using text, vector, and image functions...
p.begin_page(page_width, page_height);

/* use the template */

p.fit_image(template, 0.0, 0.0, "");
...more page marking operations...
p.end_page();
...

p.close_image(template);

しかし、次のようなエラーが表示されます。

関数をオブジェクト スコープで呼び出してはなりません。

どこで間違いを犯したのかわかりません。

ありがとう。

4

1 に答える 1

1

関数を配置していませんend_template_ext。次のようなコードを作成します。

/* define the template */
template = p.begin_template_ext(template_width, template_height, "");
...place marks on the template using text, vector, and image functions...
p.end_template_ext(0, 0);
...
p.begin_page(page_width, page_height);
/* use the template */
p.fit_image(template, 0.0, 0.0, "");
...more page marking operations...
p.end_page();
...
p.close_image(template);
于 2012-09-10T07:03:30.563 に答える