Author | Topic: Formatting HTML for Print | |
---|---|---|
Bruce Anderson | Formatting HTML for Print on Sun, 07 Aug 2005 14:39:42 -0500 Is there a way to format a HTML page so that the client can "print" the page(s) with the browser and have page breaks fall where the designer would prefer them to be? I need to dump some data and I would like to have control over the the row and column aspects of the output along with column headers, one nicely contained table per sheet of paper. Or is this only handled by using a report engine to generate a pdf output? Bruce Anderson | |
Pablo Botella | Re: Formatting HTML for Print on Sun, 07 Aug 2005 23:49:07 +0200 Hi, You have some css pseudo calsses like @media print or @page but there is no way ( or at least I don't know how to) to control de output 100% in pure HTML. For PDF creation you can use iSED PDF ActiveX that is unexpensive ( I have a free wrapper for use it with Xbase without worry about COM, the wrapper handles all at C++ level and you can use itas a regular Xbase++ class and compatible with versions 1.7,1.8 and 1.9 of Xbase++) You can buy the library at http://www.isedquickpdf.com/ and download my free wrapper at www.xbwin.com Regards, Pablo Botella | |
Allen Lee | Re: Formatting HTML for Print on Sun, 07 Aug 2005 19:17:01 -0700 Hi Bruce: Assuming that you dynamically create a temporary filled DBF and an HTML file (hDat) and where nPG is the variable counting/printing page numbers 1. Add this to the head section of the HTML fwrite(hDat,'<style type="text/css">'+CRLF) fwrite(hDat,'H1 {page-break-after:always}'+CRLF) fwrite(hDat,'</style>'+CRLF) 2. Add this to the body section of the HTML do while !eof() if nPG<>1 fwrite(hDat,'<H1></H1>'+CRLF) endif enddo | |
Klaus Overhage | Re: Formatting HTML for Print on Mon, 08 Aug 2005 06:46:36 +0200 Allen Lee schrieb: > Hi Bruce: > > Assuming that you dynamically create a temporary filled DBF and an HTML file > (hDat) and > where nPG is the variable counting/printing page numbers > > 1. Add this to the head section of the HTML > fwrite(hDat,'<style type="text/css">'+CRLF) > fwrite(hDat,'H1 {page-break-after:always}'+CRLF) > fwrite(hDat,'</style>'+CRLF) > > 2. Add this to the body section of the HTML > do while !eof() > if nPG<>1 > fwrite(hDat,'<H1></H1>'+CRLF) > endif > enddo > > or you can use paperless printer. www.DocumentCreator.com | |
Steve Woolstenhulme | Re: Formatting HTML for Print on Mon, 22 Aug 2005 18:44:58 -0500 You could wrap each page in a div rather than throwing in an empty tag. <style> DIV { page-break-after:always; } </style> <div> My text, page 1 </div> <div> My text, page 2 </div> "Allen Lee" <alee@infoprosys.net> wrote in message news:UuYIV77mFHA.6160@S15147418... > Hi Bruce: > > Assuming that you dynamically create a temporary filled DBF and an HTML > file > (hDat) and > where nPG is the variable counting/printing page numbers > > 1. Add this to the head section of the HTML > fwrite(hDat,'<style type="text/css">'+CRLF) > fwrite(hDat,'H1 {page-break-after:always}'+CRLF) > fwrite(hDat,'</style>'+CRLF) > > 2. Add this to the body section of the HTML > do while !eof() > if nPG<>1 > fwrite(hDat,'<H1></H1>'+CRLF) > endif > enddo > > | |
Sander Elias | Re: Formatting HTML for Print on Mon, 08 Aug 2005 09:52:04 +0200 Hi Bruce, >Is there a way to format a HTML page so that the client can "print" the >page(s) with the browser and have page breaks fall where the designer would >prefer them to be? I need to dump some data and I would like to have >control over the the row and column aspects of the output along with column >headers, one nicely contained table per sheet of paper. Or is this only >handled by using a report engine to generate a pdf output? Using CSS you can do this, actually you can control all output behavior using CCS, expect for 1 thing, marges!. the marges are browser depended. If you stay within them, you can position quite well. Also page-breaks are defined(and followed). Regards Sander Elias | |
Phil Ide | Re: Formatting HTML for Print on Mon, 08 Aug 2005 11:29:48 +0100 Bruce, > Is there a way to format a HTML page so that the client can "print" the > page(s) with the browser and have page breaks fall where the designer would > prefer them to be? I need to dump some data and I would like to have > control over the the row and column aspects of the output along with column > headers, one nicely contained table per sheet of paper. Or is this only > handled by using a report engine to generate a pdf output? You might want to look at HTMLDoc, which allows you to add page formatting instructions to HTML, which can later be interpreted by HTMLDoc (which is free software). This adds comments with special codes to allow you to define document-wide page header/footers, page size, margins, add macros (e.g. for page numbers) etc. Since it is added as SGML comments, it is transparent when viewed in a browser. Regards, Phil Ide ******************************************* * Xbase++ FAQ, Libraries and Sources: * * goto: http://www.idep.org.uk/xbase * * --------------------------------------- * * www.xodc.org.uk - openSource Dev-Center * ******************************************* The soul has no rainbows if the eyes have no tears. |