0

I want to give reference of the pdf as a Proxy for the generated pdf. But it is not carrying the reference to the external target. My code is as follow:

proxy = p.begin_template_ext(0, 0,"reference={target.pdf pagenumber=1 strongref=true}");
if (proxy == -1)
{
  /* Error */
}

But it always goes for error. Not sure why. Am I missing any conceptual thing in that ? And whats the best way to use it ?

Thanks.

Srijan
  • 1,234
  • 1
  • 13
  • 26
Smit
  • 1,559
  • 17
  • 38

1 Answers1

0

PDFlib can use one of the following objects as placeholder (proxy) for the reference page:

  1. Another imported PDF page (e.g. a simplified version of the target). A PDF page which serves as a proxy for an external target must have the same page geometry as the target page.

  2. A template, e.g. a simple geometric shape such as a crossed-out rectangle. Templates will be adjusted to the size and aspect ratio of the target page.

Change your code something like:

proxy = p.begin_template_ext(0, 0,
"reference={filename=target.pdf pagenumber=1 strongref=true}");
if (proxy == -1)
{
  /* Error */
}
...construct template contents...
p.end_template_ext(0, 0);

You were missing "filename" in the argument.

Smit
  • 1,559
  • 17
  • 38