Hi,
*Need some suggestion how to set Page Size for Stamper object ie A4 or
Letter size*
I am currently using the itextsharp version 5.0.5.0 for generating a pdf
document from PDF template.
I am trying to access the existing PDF template docuement and filling the
formfields dynamically( which is working fine )
and I am having a requirement that to create the docuement either in A4 or
Letter size based on the user choice ,
But the template is not either in* A4 or Letter size.*
*My question is can we set the Page size for the Stamper object?*
I am trying to set the page size of the stamper object by using the
PdfImportedPage class, but still the output is having the page size same as
the template page.
*string fileNameExisting = @"C:\path\xyz.pdf";*
* *
* string fileNameNew = @"C:\path\ABC.pdf";*
*
*
* using (var existingFileStream = new
FileStream(fileNameExisting, FileMode.Open))*
* using (var newFileStream = new FileStream(fileNameNew,
FileMode.Create))*
* {*
* // Open existing PDF*
* var pdfReader = new PdfReader(existingFileStream);*
*
*
* // PdfStamper, which will create*
* var stamper = new PdfStamper(pdfReader, newFileStream);*
* PdfImportedPage page = stamper.GetImportedPage(pdfReader,
1);*
* Console.Write(Environment.NewLine);*
* Console.Write(page.Width);*
* Console.Write(Environment.NewLine);*
* Console.Write(page.Height);*
* page.Width = 800;*
* page.Height = 600;*
*-*
*-*
*-*
*-*
*-*
*-*
*--*
*}*
--
Regards,
Chandravathi
9866000296
------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122412
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples:
http://itextpdf.com/themes/keywords.php