An Introduction to XHTM L Print Presented to the W 3C Print - - PowerPoint PPT Presentation
An Introduction to XHTM L Print Presented to the W 3C Print - - PowerPoint PPT Presentation
An Introduction to XHTM L Print Presented to the W 3C Print Symposium 2006 Dean Anderson, Hewlett-Packard Company October 17, 2006 dean.anderson@ hp.com XHTML -Print So why does the world need another print language? W e already have:
XHTML
So why does the world need another print language?
- W e already have:
- PostScript/ PDF
- PCL
– HP
- EscP – Epson
- And several others…
In the days of MS DOS – M x N Problem
M Applications N Printer Models
Basic W indows (and Mac) printing model
PC Application GDI+ (Graphics L ibrary API) Vendor Specific Printer Drivers
Vendor A Model X Vendor A Model Y Vendor B Model Q Vendor C Model W
Printer X Printer Y Printer Q Printer W Font L ibrary
Advantages of the PC Model
- Abstraction of the printer – a standard, layered
interface, for supporting printing.
- Allows the printer vendor to optimize cost tradeoffs
- The cost historically was mainly in memory size
- L
aser Engines required a full page bitmap because you could not pause in the middle of the page
- PCL
5 in HP’s case. Higher level objects are passed to the printer – Text and graphics objects
- Inkjet Engines could easily pause in the middle of the page.
- PCL
3 in HP’s case. L
- w level raster interface
Device Printing – A N ew Opportunity
Device Capability
- Very limited resources – Memory and processor speed.
- Connectivity challenges
- N o USB in many cases
- N o common IO in all cases
- However, there is a trend towards internet connectivity but usually through
the PC.
- L
imited operating system – no printer abstraction
- In some situations, no ability to load new applications.
- N o ability to load a driver
- The MxN problem would not be tolerated by vendors that did not see a
lot of value in printing, or by printer vendors that did not see a big return on investment.
Objectives for a new printer interface
- Common language across all vendors and printer
models.
- Allow for printer differentiation
- Small memory footprint
- Appropriate for laser engines and inkjet engines.
Convergence of Standards Activities
- In 2000, the Bluetooth Printer W G began working on a
Print Profile for printing from mobile phones and PDA’s.
- About the same time the UPnP Imaging Committee began
working on a Print Service for device-to-device printing in the home.
- Both needed to specify a mandatory print format and
image format for interoperability.
- Several formats were considered, but all were found
wanting:
- Postscript, PCL
, TIFF, J etSend, PDF, etc.
- Bluetooth – BPP – Blue tooth Printing Profile
- UPnP – UPnP PrintEnhanced:1
Enter Modularization & XHTML Basic
- W hen XHTML
Basic advanced to R EC, a light went on… XHTML modules offer a format that:
- Is suited for top-down, one-page-at-a-time processing;
- Utilizes fonts on the printer, but tolerant of differing font
metrics
- Is network ready (MIME type, http-equiv, etc.)
- Has a well-defined, rich toolbox and strong standards
process for growth
- Supports standard image formats
- Coupled with a suitable CSS subset, provides strong
presentation flexibility
- Provides an easy off-ramp for printing XHTML
Basic content
- Allows for the printer to manage it’s own memory
- resources. In the case of XHTML
image content can be pulled when needed as many times as needed.
W hat is XHTML
- Print?
From the Abstract:
- XHTML
- Print is member of the family of XHTML
languages defined by the Modularization of XHTML .
- It is designed to be appropriate for printing from mobile
devices to low-cost printers.
- It is targeted at printing in environments where it is not
feasible or desirable to install a printer-specific driver and where some variability in the formatting of the output is acceptable.
W hat’s Included in XHTML
- Print?
- Essentially, it’s XHTML
Basic 1.0, plus:
- Text Extension Module - Presentation
- b, big, hr, i, small, sub, sup, tt
- Scripting Module
- noscript, script (for printing of noscript; script is ignored.)
- Style Sheet Module
- style
- Style Attribute Module
- style attribute
- A requirement for baseline J
PEG support
W hy N ot J ust Use XHTML 1.0?
- It is sometimes suggested that modular profiles are not the
best approach; that it would be better to just implement the parts of XHTML that are appropriate to one’s solution; and the parsing rules will ensure graceful degradation for incomplete implementations.
- That approach would not meet the market requirements of
either printer vendors or client manufacturers for this solution: printed results must be strongly deterministic to control support costs. This implies the author must know which features are supported to ensure consistent output across all printers.
- This requires specifying which features are mandatory;
ergo, a profile.
L
- oking at printing from a W eb centric
point of view
- Paper does not allow
for a scroll bar – yet.
- Part of the challenge
was adapting XHTML to paged media – leading to the development of the CSS3 Module: Paged Media
W hy is Microsoft not interested in supporting XHTML Print?
- XHTML
- Print does not guarantee W YSIW YG
printing (W hat You See Is W hat You Get)
- Basically there is no mechanism for downloading
- r managing fonts.
- The design center for XHTML
- Print was “content is
king” – meaning it was more important to print the information then to meet W YSIW YG.
The Print L anguage is only half the problem
- Printers also require a control mechanism
- A way to submit a print job
- Track progress
- Manage exceptions
- Out of paper
- Out of ink
- Paper jam
- Paper size selection
UPnP Control Point – Object Oriented
Methods
(remote procedure calls)
- GetPrinterAttributesV2
- CreateJ
- bV2
- CreateUR
IJ
- b
- GetJ
- bAttributes
- GetMediaL
ist
- GetMargins
- CancelJ
- b
Properties
- J
- b status
- Printer State
Events
- Printer state changes
- Printer errors
R elated Standards Bodies
(Digital L iving N etwork Alliance)
Universal Plug and Play W ireless Mobile Handsets N etworked digital home services
DLNA DMPr Device DLNA DMPr Device
UPnP PrintEnhanced:1 Service UPnP PrintEnhanced:1 Service XHTML Print XHTML Print CSS Print CSS Print
UPnP Print Service Page Description Language
CSS2 Print Enhanced CSS2 Print Enhanced
DL N A Printing Profile
TCP/ IP opens up interesting solutions 2 & 3 Box Printing
UPnP Printer
2 Box Print
Content Control
Printer Controller Digital Media Server
3 Box Print
Printer Controller
Content Control Control
UPnP Printer
Content beyond the home
Internet
Content Control Control
UPnP Printer
Image Handling
- XHTML
Print does not require
- Embedded thumbnails
- Image R
- tation
- Progressive rendering
- Side-by-side images
- Memory limitations in the printer may prohibit side-by-
side image printing. In this case the printer is allowed to reformat the page.
- In all cases the printer should attempt to preserve the
content.
UPnP Photo Templates – Adopted by DL N A
- Photo Printing - A Key emerging application.
- Printers combine Images with an XHTML
template to create the printed page
+
XHTML Template Document XHTML Template Document =
2006 European Vacation 2006 European Vacation
XHTML Example – Photo Templates
- 57 Photo templates were written to make it easy
for vendors to print photos
- Available at www.upnp.org
- Allows for printing 1-8 photos on a page
- Supports many different media sizes.
- Prints “Standard photo sizes”: 10x15cm, etc..
1-up 2-up 3-up
2-up, 5x7 on A size Photo Template
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBL IC "-/ / W 3C/ / DTD XHTML
- Print 1.0/ / EN"
"http:/ / www.w3.org/ MarkUp/ DTD/ xhtml-print10.dtd"> <html xmlns="http:/ / www.w3.org/ 1999/ xhtml"> <head> <title>2up_portrait_A_5x7in</ title> <base href="http:/ / insert.proper.address.here/ " / > <style type="text/ css"> @ media print { @ page {size:letter; margin:0.2in;}} body { padding:0in; } div.page { position:relative; page-break-after:always; } div.page_last { position:relative;} div.img1 {overflow:hidden; padding:0in; position:absolute; top:0.13in; left:0.55in; width:7in; height:5in;} div.img2 {overflow:hidden; padding:0in; position:absolute; top:5.46in; left:0.55in; width:7in; height:5in;}
/ * 5 x 7 in * / img.img_23_0deg { width:7.5in; height:5in; margin-left: -0.25in; image-orientation:0deg; } img.img_23_90deg { width:7.5in; height:5in; margin-left: -0.25in; image-orientation:90deg; } img.img_23_180deg { width:7.5in; height:5in; margin-left: -0.25in; image-orientation:180deg; } img.img_23_270deg { width:7.5in; height:5in; margin-left: -0.25in; image-orientation:270deg; } img.img_34_0deg { width:7in; height:5.25in; margin-top: -0.125in; image-orientation:0deg; } img.img_34_90deg { width:7in; height:5.25in; margin-top: -0.125in; image-orientation:90deg; } img.img_34_180deg { width:7in; height:5.25in; margin-top: -0.125in; image-orientation:180deg; } img.img_34_270deg { width:7in; height:5.25in; margin-top: -0.125in; image-orientation:270deg; } img.img_916_0deg { width:8.889in; height:5in; margin-left: -0.944in; image-orientation:0deg; } img.img_916_90deg { width:8.889in; height:5in; margin-left: -0.944in; image-orientation:90deg; } img.img_916_180deg { width:8.889in; height:5in; margin-left: -0.944in; image-orientation:180deg; } img.img_916_270deg { width:8.889in; height:5in; margin-left: -0.944in; image-orientation:270deg; } </ style>
Image R
- tation
Landscape (Most Common) Use 0deg rotation Reverse Landscape (Rare) Use 180 deg rotation Reverse Portrait (Common) Use 90 deg Rotation Portrait (Common) Use 270 deg rotation
Center Cropping
5x7 3:4 2:3 9:16
<body> <!-- Page 1-(n-1) --> <div class="page"> <div class="img1"><img src="image1.jpg" class="img_yy_xxxdeg" alt="photo"/ ></ div> <div class="img2"><img src="image2.jpg" class="img_yy_xxxdeg" alt="photo"/ ></ div> </ div> <!-- Page L ast --> <div class="page_last"> <div class="img1"><img src="image3.jpg" class="img_yy_xxxdeg" alt="photo"/ ></ div> <div class="img2"><img src="image4.jpg" class="img_yy_xxxdeg" alt="photo"/ ></ div> </ div> </ body> </ html>