G
G
goodwinsis2013-11-29 15:18:33
C++ / C#
goodwinsis, 2013-11-29 15:18:33

How to generate PDF form with page numbers inside content?

I was faced with the task of generating a PDF form, to be more precise, a consignment note.
The difficulty is to know the number of sheets produced, since this number is indicated on the form, and the position of this inscription may be yours or lower, depending on the number of items on the consignment note. That is, the method of rigid insertion by coordinates does not suit me.
You can, of course, calculate the number of points on one page and determine the number of pages by the number of points, but this method requires a strict specified cell height, which can lead to information loss.
I tried to use itextsharp as an engine, I ran into the fact that it only knows how to add a page number to the already generated file at the end, or rather it gets its values, by pagevent machinations.
Basically a project in c#.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vitaly Peretyatko, 2013-11-29
@viperet

I used Latex to generate PDF: I generated .tex according to the template, then I generated PDF from it.
In latex, the problem of inserting the number of pages is solved simply:
\usepackage{lastpage}
...
in the document \pageref{LastPage} pages
Taco's approach is very convenient for server applications, most likely it won't suit you...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question