473,386 Members | 1,798 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

XML and Pre-Printed Formsets

I need to print the following invoice.xml data onto a standard
pre-printed invoice formset. Meaning a form that is pre-printed with
boxes, blocks and columns which identify where each data element must
print.

When displayed by a browser, this record appears nicely as an invoice
form, after being translated through an xsl style sheet (titles and
headings are displayed from the style sheet.) Ideally, I want to place
a button on this screen which will provide a way to print the displayed
invoice onto the pre-printed invoice formset.

invoice.xml
-<invoice id="178761" custid="1212" model="20">
<customer>MARITIME SHOPPING</customer>
<custad1>c/o MARINE FITTERS</custad1>
<custad2>31375 JOHNSON DR</custad2>
<custad3>SAN DIEGO</custad3>
<custad4>CA</custad4>
<custad5>91821</custad5>
<contact>Davy Jones</contact>
<phonbr>555-444-5555</phonbr>
<faxnbr>555-333-4321</faxnbr>
<ordate>06 Apr 2006</ordate>
<schedule>Early April</schedule>
- <lines>
- <line id="1">
<optdesc>Compass</optdesc>
<featid>ABC700</featid>
<feature>700 - 3in Compass</feature>
<qty>1</qty>
<price>$270</price>
<item>1231148</item>
</line>
- <line id="2">
<optdesc>Marine Radio</optdesc>
<featid>STND100</featid>
<feature>Standard Radio Transceiver Model 100</feature>
<qty>1</qty>
<price>$650</price>
<item>13802</item>
</line>
</lines>
<total>$920</total>
<dest>CALIFORNIA</dest>
<tax>73.60</tax>
<freight/>
<discount/>
<amount>$993.60</amount>
</invoice>

Apr 20 '06 #1
3 1282
In other words, you want to do very precise layout of what data appears
where on the printed page, right?

Sounds like a good job for XSLT to XSL-FO to a suitable renderer. (Or
XSLT to other page-layout language like LaTex to a renderer for that,
but then you're bridging out of the XML world.) The result's likely to
be a PDF which is what you'll actually print, unless you've got a
renderer that talks to printer drivers directly.

Fiddly detail, but straightforward. Not something that's likely to be a
button on a browser, though, unless you're willing to download a
considerable amount of code or browsers finally start supporting XSL-FO
(which would be nice but unfortunately I don't see it happening very
quickly).

--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
Apr 21 '06 #2
Joe Kesselman wrote:
Fiddly detail, but straightforward.


At least, straightforward on a printer you've calibrated for. Messy if
printer resolution and paper alignment and so on vary; then you need to
design an adjustment process into the system. (It's easier to print the
whole form with data inserted rather than to print into proper alignment
with a pre-printed form; if it's all coming from the computer everything
scales/shifts the same.)

In any case, what you do is treat the source XML as formatted data, and
run it through a "compilation" process to get it into a form that'll
print how/where you want it to. Exactly what the steps are depends on
what you're doing. As with any other kind of data formatting, there are
multiple reasonable ways to approach itt.

--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
Apr 21 '06 #3
Joe Kesselman wrote:
In other words, you want to do very precise layout of what data appears
where on the printed page, right?

Sounds like a good job for XSLT to XSL-FO to a suitable renderer. (Or
XSLT to other page-layout language like LaTeX to a renderer for that,
but then you're bridging out of the XML world.)
LaTeX is a common solution to this because it produces PDF very well.
The result's likely to
be a PDF which is what you'll actually print, unless you've got a
renderer that talks to printer drivers directly.
The big problem with sending people PDF (or letting them generate it
from a button) is that their local PDF-viewer which they use to print
with under MS-Windows is likely to have the "Scale to fit page" option
set, which will completely screw up all your spacing and measurement.
You need some way to ensure that it will get printed as-is, without
any smart-ass software intervening.
Fiddly detail, but straightforward. Not something that's likely to be a
button on a browser, though, unless you're willing to download a
considerable amount of code or browsers finally start supporting XSL-FO
(which would be nice but unfortunately I don't see it happening very
quickly).


This is one reason why using LaTeX may be an option. Provided your code
is robust enough (ie it will cope with any silly data the user has got
in the form, like control characters or backslashes), it's possible
to write a CGI script to run XSLT into LaTeX into PDF direct.

///Peter
Apr 23 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

21
by: Headless | last post by:
I've marked up song lyrics with the <pre> tag because it seems the most appropriate type of markup for the type of data. This results in inefficient use of horizontal space due to UA's default...
7
by: Alan Illeman | last post by:
How do I set several different properties for PRE in a CSS stylesheet, rather than resorting to this: <BODY> <PRE STYLE="font-family:monospace; font-size:0.95em; width:40%; border:red 2px...
2
by: Buck Turgidson | last post by:
I want to have a css with 2 PRE styles, one bold with large font, and another non-bold and smaller font. I am new to CSS (and not exactly an expert in HTML, for that matter). Is there a way to...
5
by: Michael Shell | last post by:
Greetings, Consider the XHTML document attached at the end of this post. When viewed under Firefox 1.0.5 on Linux, highlighting and pasting (into a text editor) the <pre> tag listing will...
8
by: Jarno Suni not | last post by:
It seems to be invalid in HTML 4.01, but valid in XHTML 1.0. Why is there the difference? Can that pose a problem when such a XHTML document is served as text/html?
7
by: Rocky Moore | last post by:
I have a web site called HintsAndTips.com. On this site people post tips using a very simply webform with a multi line TextBox for inputing the tip text. This text is encode to HTML so that no...
9
by: Eric Lindsay | last post by:
I can't figure how to best display little snippets of shell script using <pre>. I just got around to organising to bulk validate some of my web pages, and one of the problems occurs with Bash...
23
by: Xah Lee | last post by:
The Concepts and Confusions of Pre-fix, In-fix, Post-fix and Fully Functional Notations Xah Lee, 2006-03-15 Let me summarize: The LISP notation, is a functional notation, and is not a...
14
by: Schraalhans Keukenmeester | last post by:
I am building a default sheet for my linux-related pages. Since many linux users still rely on/prefer viewing textmode and unstyled content I try to stick to the correct html tags to pertain good...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.