Sorry for the noobie-like nature of this question, but I am struggling with the API and the task I currently have.
The content of my PDF document is generated dynamically, piece by piece and may consist of run-time generated instructions to append a series of styled labels in a paragraph. These labels can be of different fonts, colour, bold etc. and most importantly of varying lengths, all unknown at design time.
My question is: how do I concatenate these labels into a single paragraph, with word wrapping and page breaks?
e.g.
[Instruction 1 text] [Instruction 2
text in bold that wraps over the end
of a line and may even wrap over the
-- page break --
end of the current page] [Instruction
3 text in italics]
I cannot see how to solve this issue when labels and text areas need a rectangular WxH area, which it seems are incumbent on me to somehow calculate. I simply do not know at design time whether an instruction will result in a single word or many lines of text.
The "instruction 2" text does not even have a rectangular shape and its initial X/Y coordinates are dependent on the value of instruction 1's text.
Please can you offer some guidance and point me to the relevant DynamicPDF Generator API methods that can help me with this requirement?
Thanks,
Neil
Dynamic content positioning
Re: Dynamic content positioning
Support · Aug 9, 2013Hello Neil,
You can add dynamic text contents to the PDF document without any problem using our DynamicPDF Generator for .NET product. You can use either TextArea or FormattedTextArea to do this. You can refer the documentation on TextArea here
and FormattedTextArea here
.
If you would like to have text with different font and styles then you will need to build the HTML string by setting the desired color, font and style and add this text to the PDF using FormattedTextArea page element. You can refer the supported HTML tags here
.
You can set the desired dimensions (width and height) for the page elements using respective Width and Height properties of page elements. Also you can overflow the contents to the next page. You can refer documentation on continuing text using TextArea page element here
. Similarly you can add over flow contents of the FormattedTextArea to the new page.
You can also contact our [^a|mailto:support@cete.com|opennewwindow|support^] team if you have any further technical queries.
Thanks,
ceTe Software Support Team.