1
Answer

Windows control library in Internet Explorer

weird_littlegirl

weird_littlegirl

20y
1.8k
1
Hi there, I'm trying to put a Windows control library that I created into a web page. The problem is when the page loads, I don't see anything, I just see a box where the control is supposed to be, but the control doesn't seem to load. I tried putting this control library into a regular windows form, and it works fine... Anyone know what the problem might be? The only thing I might see as a problem is that the control library has to connect to a database... But for now, both web server and database server are located on my local machine, so I just connect to the DB using Data Source=(local). Thanks in advance!!
Answers (1)
1
Manav Pandya

Manav Pandya

NA 7.1k 24.1k 7y
I have best answer for you :
 
https://stackoverflow.com/questions/31668595/how-to-insert-header-and-footer-to-existing-pdf-document-using-itextsharp-witho
 
https://www.aspsnippets.com/Articles/iTextSharp-Add-Page-numbers-to-existing-PDF-using-C-and-VBNet.aspx
 
http://www.nullskull.com/q/10105908/itextsharp--adding-footers.aspx
 
Thanks 
0
Sagar  Pandurang Kap

Sagar Pandurang Kap

NA 2.7k 7.5k 7y
Hi,
 
https://www.aspsnippets.com/Articles/iTextSharp-Add-Page-numbers-to-existing-PDF-using-C-and-VBNet.aspx
 
Hope it helps...
-1
hong di

hong di

NA 15 1.2k 11y
It seems that this question has been asked in many different forums. I googled and find the most proper one for you, in which no external PDF creator or PDF reader SDK is required. Hope it can help you a little.

" Have a look at
chapter 6 of iText in Action, 2nd edition, especially at subsection 6.4.1: Concatenating and splitting PDF documents.
Listing 6.22,
ConcatenateStamp.java, shows you how you should create a PDF from copies of pages (in your case: all pages) of multiple other PDFs; the sample additionally adds a new "Page X of Y" footer; this demonstrates how you can add content at given positions on the pages while merging the source files.

"

The answer is from
http://stackoverflow.com/questions/13465657/itext-add-content-to-the-bottom-of-an-existing-page
-1
Ring Zhong

Ring Zhong

NA 307 52.7k 11y
Hi Rahul,
Maybe it cannot be implemented directly, here is a kind of method to help draw the footer in existing pdf file. Of course, it need to use another component but not iTextSharp, it's Spire.PDF. Try the code below,
private static void DrawPageNumber(PdfPageCollection section, PdfMargins margin, int startNumber, int pageCount)
{
foreach (PdfPageBase page in section)
{
page.Canvas.SetTransparency(0.5f);
PdfBrush brush = PdfBrushes.Black;
PdfPen pen = new PdfPen(brush, 0.75f);
PdfTrueTypeFont font = new PdfTrueTypeFont(new Font("Arial", 10f, FontStyle.Bold), true);
PdfStringFormat format = new PdfStringFormat(PdfTextAlignment.Right);
format.MeasureTrailingSpaces = true;
float space = font.Height * 0.75f;
float x = margin.Left;
float width = page.Canvas.ClientSize.Width - margin.Left - margin.Right;
float y = page.Canvas.ClientSize.Height - margin.Bottom + space;
page.Canvas.DrawLine(pen, x, y, x + width, y);
y = y + 1;
String numberLabel
= String.Format("{0} of {1}", startNumber++, pageCount);
page.Canvas.DrawString(numberLabel, font, brush, x + width, y, format);
page.Canvas.SetTransparency(1);
}
}
article:
http://www.e-iceblue.com/Knowledgebase/Spire.PDF/Program-Guide/Add-PDF-Footer.html
-1
Praveen N

Praveen N

NA 154 7.7k 11y
  1.                         PdfContentByte underContent = pdfStamper.getUnderContent(i);  
  2.                         PdfContentByte overContent = pdfStamper.getOverContent(i);  
  3.   
  4.                         PdfPTable footer = new PdfPTable(2);  
  5.                 footer.setTotalWidth(1000);  
  6.                 footer.getDefaultCell().setHorizontalAlignment(Element.ALIGN_LEFT);  
  7.                 footer.addCell(new Phrase("Footer First Page"));  
  8.                 footer.addCell(new Phrase("Footer Prev Page"));  
  9.                 footer.addCell(new Phrase("Footer Next Page"));  
  10.                 footer.addCell(new Phrase("Footer Last Page"));  
  11.                   
  12.                 PdfPTable header = new PdfPTable(3);  
  13.                 header.setTotalWidth(1000);  
  14.                 header.getDefaultCell().setHorizontalAlignment(Element.ALIGN_LEFT);  
  15.                 header.addCell(new Phrase("Header Page"));  
  16.                 header.addCell(new Phrase("Header Page"));  
  17.                 header.addCell(new Phrase("Header Page"));  
  18.                   
  19.                   
  20.                 Document document = underContent.getPdfDocument();  
  21.                 Document overDocument = overContent.getPdfDocument();  
  22.                   
  23.                 header.writeSelectedRows(0, -1,  
  24.                         (overDocument.right() - overDocument.left() - 300) / 2  
  25.                                 + overDocument.leftMargin(), overDocument.top() - 10, overContent);  
  26.                   
  27.                 footer.writeSelectedRows(0, -1,  
  28.                         (document.right() - document.left() - 300) / 2  
  29.                                 + document.leftMargin(), document.bottom() - 10, underContent);  

Thanks & Regards,

Praveen Nelge