html-to-pdf

Generate pdf using iTextSharp for different languages

回眸只為那壹抹淺笑 提交于 2019-12-13 10:44:21
问题 I have tried different options, but it did not work. The code generated pdf for English but does not work for other languages. using (var ms = new MemoryStream()) { // Create an iTextSharp Document which is an abstraction of a PDF but **NOT** a PDF var doc = new Document(); { // Create a writer that's bound to our PDF abstraction and our stream var writer = PdfWriter.GetInstance(doc, ms); { // Open the document for writing doc.Open(); string finalHtml = string.Empty; // Read your html by

How do I create a blank PDF signature field using an HTML input document or after exporting to PDF using ABCPDF?

谁都会走 提交于 2019-12-13 04:37:44
问题 I have a source HTML document generated from an ASPX. I then convert the html to PDF using ABCPDF. The html has a signature area, which is just a text box with a border. I need a signature field inside the PDF with a name that I can pass on. The PDF will be sent to a third-party who will correspond with the client and then digitally sign the PDF and send it back. Given that I have an html document, or PDF, how do I programmatically add the blank PDF signature field around the original html

PDF to HTML and HTML to PDF solution in php

大憨熊 提交于 2019-12-13 01:59:24
问题 I need to convert a PDF document to HTML and after editing the html I then convert this HTML to PDF . I use 'pdftohtml' ubuntu command (pdftohtml - program to convert pdf files into html, xml and png images) like PHP code below <?php $output = shell_exec('pdftohtml create.pdf updated.html'); ?> It convert the whole document successfully but it pass all image in top of the page. Can anyone help me to do this job ? 回答1: You can preserve the layout of your document (headers, footers, paging, etc

How to convert url of html page to pdf in java using iText & flying saucer?

旧巷老猫 提交于 2019-12-12 11:12:57
问题 I've just downloaded xhtmlrenderer and iText jar files. I can make pdf files by using these jars. What I exactly want is: I need to create pdf if I give one valid URL (say " https://xhtmlrenderer.dev.java.net/news.html ") in the place of "inputFile". Is it possible with flying saucer and iText? If yes, please guide me to achieve this. Also, when I'm trying to run the below code, I'm getting error: stream closed import java.io.*; import com.lowagie.text.DocumentException; import org

Rendering ASP.NET MVC ViewResult HTML as image without third party components

故事扮演 提交于 2019-12-12 08:58:13
问题 is there a way to render ViewResult or PartialViewResult as an image? I have tried to get ViewResult as string and I got a string containing html as it should be, but I need to render that html to image. If it is possible - with styles and images. I have an idea to get some browser output for this html on server and capture result to an image, but how it can be done in practice I don't know at this time. If you have any ideas, please, help. Please do not suggest any third party components.

Convert HTML to PDF using HtmlRenderer [closed]

妖精的绣舞 提交于 2019-12-12 07:39:33
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 11 months ago . I am looking to use HtmlRenderer to convert an HTML file to a PDF file. I have seen it being mentioned on several sites that it is possible. However, I don't seem to be able to find any basic sample code to do this. I have added the following NuGet package. Install-Package

Scaling HTML from transcribed PDF files

可紊 提交于 2019-12-12 05:48:10
问题 I have a few PDF files that were converted to HTML. I fully understand that this isn't ideal, but that's not something I can change. The issue is that it places content at very specific points which breaks mobile responsiveness. A typical HTML will looks like this: <div class="pc pc1 w0 h0"> <div class="t m0 x0 h2 y1 ff1 fs0 fc0 sc0 ls0 ws0">Text</div> </div> And the CSS file like this: @media screen and (-webkit-min-device-pixel-ratio:0){ .sc_{-webkit-text-stroke:0px transparent;} .sc0{

How I can break my document correctly with DOMPDF?

让人想犯罪 __ 提交于 2019-12-12 05:27:30
问题 I want to generate a PDF with DOMPDF through dynamic content. I am creating a table like this: <?php $language = $this->input->cookie('language'); if (!isset($language)) { $language = $core_settings->language; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta name="Author" content=""/> <meta http-equiv="Content-Type" content="text/html;

How do I convert malformed HTML to PDF with iText and XMLWorker?

别等时光非礼了梦想. 提交于 2019-12-12 04:33:17
问题 I am trying to convert HTML(with external CSS) into PDF using Itext XMLWorkerHelper, am facing the run-time exception whenever XMLWorkerHelper parses a malformed HTML. For example: The html below has input tag not closed : and XMLWorkerHelper cannot parse and throws run-time exception. if i try with proper HTML input tag enclosed,it works fine. How can i convert malformed or complex HTML (along with css) to PDF using Itext. below is my code: var test_html = File.ReadAllText("C:/Desking _

iTextsharp base64 embedded image in header not parsing/showing

♀尐吖头ヾ 提交于 2019-12-12 02:16:08
问题 Background: I have an editor where I can edit the header and footer of a document in HTML and then merge them into the main document. Base64 Embedded images work perfectly within the main document content, but in the Headers or footers they vanish (so if I have a main document with image1.png in and this document has a header with image_header.png in, image1 will be showing, image_header won't). What it looks like to me is that the tag processor is not being applied to the elements within the