From owner-freebsd-questions@freebsd.org Thu Aug 3 03:37:30 2017 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6CE2DC6471 for ; Thu, 3 Aug 2017 03:37:30 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mailrelay13.qsc.de (mailrelay13.qsc.de [212.99.187.253]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.antispameurope.com", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1856F646D6 for ; Thu, 3 Aug 2017 03:37:29 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx01.qsc.de ([213.148.129.14]) by mailrelay13.qsc.de; Thu, 03 Aug 2017 05:37:20 +0200 Received: from r56.edvax.de (port-92-195-203-176.dynamic.qsc.de [92.195.203.176]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx01.qsc.de (Postfix) with ESMTPS id D08BE3C77D; Thu, 3 Aug 2017 05:37:19 +0200 (CEST) Received: from r56.edvax.de (localhost [127.0.0.1]) by r56.edvax.de (8.14.5/8.14.5) with SMTP id v733bIFA002882; Thu, 3 Aug 2017 05:37:18 +0200 (CEST) (envelope-from freebsd@edvax.de) Date: Thu, 3 Aug 2017 05:37:18 +0200 From: Polytropon To: William Dudley Cc: freebsd-questions Subject: Re: html -> pdf conversion + pdf generation Message-Id: <20170803053718.ed6d97e4.freebsd@edvax.de> In-Reply-To: References: <85a6a91f-bf58-3d76-befa-6fee0a4bb6c8@paz.bz> Reply-To: Polytropon Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-cloud-security-sender: freebsd@edvax.de X-cloud-security-recipient: freebsd-questions@freebsd.org X-cloud-security-Virusscan: CLEAN X-cloud-security-disclaimer: This E-Mail was scanned by E-Mailservice on mailrelay13.qsc.de with 24342683619 X-cloud-security-connect: mx01.qsc.de[213.148.129.14], TLS=1, IP=213.148.129.14 X-cloud-security: scantime:.1323 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Aug 2017 03:37:30 -0000 On Wed, 2 Aug 2017 23:27:52 -0400, William Dudley wrote: > HTML conversion to anything is messy and inaccurate in my experience. HTML is not "pixel perfect" and not "print ready" even though there are means to achieve good formatting in CSS. However, just let the user have a standard paper format like ISO A4 instead of US Letter and you'll have the chance to get quite surprising results. :-) I think web browsers whose primary function is to render HTML (and CSS and JS and images and media, to a certain extent) are the best tool to generate PDFs from web pages (which is a good term to summarize what "HTML" in the subject refers to, because it _never_ is "just HTML"), and the browser's print function can easily create PDF files, even with "extensions" like headers or footers with title or page number. It probably is even possible to use this approach in a "headless way", i. e., without user interaction and driven from command line, so converting bigger amounts of web pages to PDF can be done automatically. This is all of course nonsense when you are a VC-backed startup in the market of B2C leverage interactive social BS ninja agile mobile web big data NoQSL real-time ad revenue organic unicorn devops service-as-a-service service and you want to make yourself fully dependent on 3rd party tools for anything you do... ;-) -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...