Skip to content

Instantly share code, notes, and snippets.

@RazorAnt
Created November 2, 2012 03:09
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save RazorAnt/3998480 to your computer and use it in GitHub Desktop.
Save RazorAnt/3998480 to your computer and use it in GitHub Desktop.
iText XML Samples
<itext creationdate="@DateTime.Now.ToString()" producer="RazorPDF">
<paragraph style="font-family:Helvetica;font-size:18;font-weight:bold;font-style:italic;">
<chunk red="255" green="0" blue="0">@ViewBag.Title</chunk>
</paragraph>
<table width="100%" cellpadding="1.0" cellspacing="1.0" widths="5;5">
<row>
<cell borderwidth="0.5" left="false" right="false" top="false" bottom="true">User Name</cell>
<cell borderwidth="0.5" left="false" right="false" top="false" bottom="true" horizontalalign="right">Lucky Number</cell>
</row>
</table>
<image url="@Context.Server.MapPath("~/Content/sample.png")"/>
<newline />
<list numbered="true" symbolindent="15" font="unknown">
<listitem leading="18.0" font="Times" size="12.0" align="Default" indentationleft="15.0">
<chunk font="Times" size="12.0">List item</chunk>
</listitem>
</list>
<anchor fontstyle="normal, underline" red="0" green="0" blue="255" reference="http://nyveldt.com/blog/">
My blog
</anchor>
</itext>
@catherine85
Copy link

Hello , where I can find something else about these syntax.

@shahirm
Copy link

shahirm commented Jan 27, 2016

Hello, How can I put text over an image in Razor pdf?

My requirement is to just put some dynamic text at the center of an image at the center of the page , I tried everything but the text is always outside the image. Please help.

@sujaychak
Copy link

How to render Chinese text in PDF? text shall be fetched from Resource string.
any help please

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment