Generate a PDF poster in C# -
I need to generate a poster in a PDF format based on a template. This PDF should have custom text and image provided through a web application. I know that you can add fields in a PDF, then fill them with something like iTextSharp (I am using #), but They have a solid background, so the posters can not be overlaid. I have tried to make a transparent form control in the OpenOffice but it does not seem likely. Can anyone recommend a way to fulfill this requirement?
Many thanks
This can be done using ITxSHRP . Its a very powerful PDF library, keep the background as a PDF and load it into a stream. You can then write on the loaded PDF and return the poster.
Private PDF contentbite_pbb; Document document = new document (); Filestream file stream = new file stream (file path, open filemodel, file access reader); PdfReader Mypdfreader = New PDF Reader (file stream); PDF template background = author. GetImportedPage (Mypdfreader, 1); Document.NewPage (); _pcb = writer.DirectContentAnder; _pcb.AddTemplate (background, 0, 0); _pcb = Authors Direct content; _pcb.BeginText (); _pcb.SetFontAndSize (BaseFont.CreateFont (BaseFont.TIMES_ROMAN, BaseFont.CP1252, False), 10); _pcb.ShowTextAligned (PdfContentByte.ALIGN_LEFT, text, 10, 5, 0); // 10,5 x and y coordinates resp. _pcb.EndText (); Writer.flush (); FileStream.Close ();
or view sample
Comments
Post a Comment