I am converting my html pages to pdf using wkhtmltopdf.
I put image as my header in my html file.But when data is large and after converting the pdf breaks down into few pages.
My header logo comes only on first page.
Is there any way to fix the header throughout all the pages in my case the company logo .. so even if data is large and after converting it splits down into multiple pages , i would like to have header for each page.. my image logo.
Belo is my code i tried so far ..
protected void btnExportToExcel_Click(object sender, EventArgs e) { WorkingWay3(); } private void WorkingWay3() { string pdfExportPath = profile + ApConfig.CurrentCompany.CompId + "/" + ApConfig.CurrentUser.EmpId.ToString(); if (!Directory.Exists(Server.MapPath(pdfExportPath))) { Directory.CreateDirectory(Server.MapPath(pdfExportPath)); } else { pdfExportPath = pdfExportPath + "/Objectives.pdf"; } string objpath = Server.MapPath(pdfExportPath); HtmlToPdf("http://localhost:32370/User/PerformancePDF.aspx", @"D:/Projects/New.pdf"); Response.Clear(); Response.AddHeader("Content-Disposition", "attachment; filename=DownloadedFile.zip"); Response.ContentType = "application/zip"; objZip.Save(Response.OutputStream); Response.End(); } private void HtmlToPdf(string website, string destinationFile) { ProcessStartInfo startInfo = new ProcessStartInfo(); startInfo.UseShellExecute = false; startInfo.RedirectStandardOutput = true; startInfo.RedirectStandardInput = true; startInfo.RedirectStandardError = true; startInfo.CreateNoWindow = true; startInfo.FileName = "C:\\Program Files\\wkhtmltopdf\\bin\\wkhtmltopdf.exe"; startInfo.Arguments = website + " " + destinationFile; Process myProcess = Process.Start(startInfo); myProcess.WaitForExit(); myProcess.Close(); objZip.AddFile(destinationFile, "Files"); }
Peter JohnPosted Jan 15, 2016, 6:32 AM
One of the most common ways of disseminating information is through PDF files. PDF, which stands for Portable Document Format, is the file format used by Adobe Acrobat. Many people receive information in PDF format, but then want to transfer that information to a Word document so they can work with it.
There are a couple of ways that you can get text from a PDF file to a Word document. Exactly which ones you can use depends on how the PDF file is protected. If the file is not protected, try these steps:
This transfers the text to your Word document. It is only the plain, unformatted text, but you can now work with it in Word.
If you have Adobe Acrobat 7 (or a later version) you can actually export a PDF document in either RTF or Word document format. (This won't work with Adobe Reader; you must have the full version of Acrobat.) Simply load the PDF and choose File | Save As. In the dialog box, choose Word document as the Save As Type. When you click Save, the document file is created.
If the PDF file is protected (authors can set security settings on PDF files so they are protected), then you won't be able to use either of the foregoing solutions. Instead, you will need to look to a third-party solution.
If you already have a scanner and OCR software, you can print the PDF file, then scan the document and use the OCR software to convert it to a Word document. One company has taken the OCR process a step further, allowing you to skip the scanning and instead convert directly from PDF. If you are interested in this product, it is called PDF Transformer, from ABBYY software:
http://www.dianaboluk.co.uk/Florentin BadeaPosted Nov 14, 2014, 10:29 AM
For that, I recommend a commercial library, if you can use one: ExpertPdf Html To Pdf Converter is the best I have used.