transparent back ground

deathdude

New Member
When using html to PDF i m getting odd results trying to align a bit of text in dead center of page without a colored background to the div.now i can not seem to be able to get an h1 or p to pad from the top either but i can get a div to pad down, but not align center.Any tips for me please.:}\[code\]PdfReader template = new PdfReader(Server.MapPath("~/Cirtificate.pdf"));Document document = new Document(PageSize.A4);PdfWriter writer = PdfWriter.GetInstance(document, new FileStream(Server.MapPath("~/test.pdf"), FileMode.Create));document.Open();PdfContentByte cb = writer.DirectContent;PdfImportedPage page = writer.GetImportedPage(template, 1);document.NewPage();cb.AddTemplate(page, 0, 0);WebClient wc = new WebClient();string htmlText = wc.DownloadString("http://localhost:65061/TEST_OUTPUT_PAGE.html");StringReader sr = new StringReader(htmlText);XMLWorkerHelper.GetInstance().ParseXHtml(writer, document, sr); document.Close();Response.Redirect("~/test.pdf");\[/code\]CSS\[code\]html, body { display: block; clear: both; float: left; position: static; overflow: visible; width: 100%; height: 100%; margin: 0px; border: 0px; padding: 0px; background-color: #fff;}body { font-family: Arial, Sans-Serif; text-align: center; color: #000; font-size: 12px; line-height: 100%; text-align: center;}\[/code\]
 
Back
Top