AW: Regression tests was: Re: Output from NIST test suite

2003-12-26 Thread J.U. Anderegg
> Peter Kullmann wrote:
>
> As an alternative approach for c) one could create tests along
> the following lines: Suppose you want to test left margin
> properties of a block. For this a simple fo file is rendered as
> a bitmap. The bitmap will not be compared to a reference bitmap
> but some elementary assertions are calculated. For instance one
> such assertion could be: "The rectangle of width 1 inch of the
> left edge is blank." I don't know of a tool that can do this
> but it should be pretty straight forward to implement.
>

There are 2 test points: renderer input and renderer output:

- Renderer input: establish the SVG renderer as reference and use an 'XML
file compare' program. The XSL Committee will hopefully prepare samples to
demonstrate and validate concepts and rules.

- Renderer output: Acrobat has a 'PDF document compare' function. This type
of the tool validates the PDF renderer. The AWT renderer can be validated
too by having the Java Printing System generate a PDF document with a PDF
printer driver. The Java Printing System can generate PCL files as well, if
better suited.

There will always be problems, because equivalent, valid results may be
achieved by different graphic objects or different sequences of graphic
calls. Therefore there will always be automated and manual/visual methods.

Hansuli Anderegg




AW: AW: What should I be doing ?

2003-12-20 Thread J.U. Anderegg
Christian Ziesemer wrote:
>
> Do you know other projects dealing with high quality typesetting with
> Java or if Java 1.5 will bring improvements? I'm thinking about writing
> my diploma thesis about how to extend the current/implement a
> typesetting API for Java.

Batik extends text attributes with kerning, word and character spacing. The
beauty of pure Java2D text is : you do not have to preprocess fonts files
and to deal with glyph metrics. If you want I will send you my font test
program. There will be a Java2D text rework in Java 1.5 to eliminate bugs
and improve some internals.

What is your idea of a typesetting API? Something like a FOP renderer
interface, storing a document as graphics objects in memory, a formatter?

Hansuli Anderegg




AW: What should I be doing ?

2003-12-17 Thread J.U. Anderegg
It might be helpful to take the renderer programmer's view:

- A meaningful renderer interface has to be specified now, i.e. the
representation of pages either in memory or serialized. More supported XSL
properties lead to bigger storage requirements.

- Renderers take over pages consisting from some graphic objects with
absolute sizes and positions. Anything between FO input and these graphics
is completely irrelevant to renderers.

- Layouters and area tree builders may produce fantastic documents on an
extremely efficient way, conforming to specifications etc.: but what, if
renderers are not able to render graphic objects, to handle orientations and
directions - as it's the case with the PCL renderer nowadays?

- Testing, validation is another topic. Java2D is the reliable rendering
system unless you want to use the Adobe product as benchmark.

When it comes to a Java2D renderer (former AWT renderer), there are these
facts regarding text rendering, font support:

o Java supports TrueType, OPI and Type1 fonts
o XSL properties : Java TextAttribute's = 1:1
- TextAttribute maps give a binary object representation for XSL font
properties in Java (more Float's than int's)
- Java2D 1.4 does not process stretch and weight properly (hopefully fixed
in Java 1.5), variant is not supported
- font face picking by Java 1.4 is funny: a static font mapping is required
to get predictable results
o Java2D supports font metrics, i18n, bidi and Unicode well
o Java2D does not support
- word and character spacing: may be programmed by inserting white space
- kerning: info not available in font metrics

Similar observations apply to Java2D strokes, rectangles and images.

Hansuli Anderegg




A Java2D Renderer/Viewer Prototype

2003-07-10 Thread J.U. Anderegg
Orientations, writing directions, bidi, Asian languages, precise
coordinates, drawing priorities, page caching, paragraph formatting: this
renderer/viewer handles it. With low memory usage.

See: http://mypage.bluewin.ch/huanderegg

Hansuli Anderegg



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]



AW: Alternative API proposal (was: startup refactoring)

2003-06-26 Thread J.U. Anderegg
> J.Pietschmann wrote
> I think we have a few slightly more pressing problems:
> - improving the API to ease embedding (including Java2D embedding)

What has to be embedded?

> Adding multiple output streams is certainly fun but I suspect the
> bulk of the current users would be more interested in one of the
> points above. And somehow I have the feeling that your approach could
> easily get in the way, in particular I wouldn't like if it would
> *increase* memory usage in general.

Multiple output streams are here with FOP 0.x.x
The AWT viewer uses the area tree as page cache and it's print function
again.

I'm experimenting with a new Graphics2D renderer. The attached description
gives some hints to configuration/parametrization requirements. Directions,
orientations, i18n will be the next topics. All I know at the time is that
present renderers need heavy upgrades.

Hansuli Anderegg
Title: JPS Renderer/Viewer



FOP Renderer/Viewer based on Java Printing System, Graphics2D


Project: JPS Renderer/Viewer
Author: J.U. Anderegg
E-Mail: [EMAIL PROTECTED]

The Java Printing System enables applications to:

Print Java 2D™ graphics, text and images.
Control document-composition functions such as soft collating, reverse
order printing, and booklet printing.
Invoke printer-specific functions such as duplex (two-sided) printing and
stapling.
Print on all platforms, including Windows and Solaris.
Data stream generation by platform printer drivers.

Highlights


Silent/interactive operation (page/printer/file dialogs)
Output to printer or file
Supported printers, data streams: PCL, AFP, Postscript, Text, PDF
(PDFWriter required)
Accurate output control by setting page/printer properties of drivers
Several renderings per run
Image Formats: JPEG, PNG, GIF (with JAI Image I/O Tools 1.0-rc also BMP,
TIFF)
SVG Support
Embed HTML, RTF and TXT documents
Orientation switch portrait/landscape within document
Controls per print job

Destination file
Media sizes, bins, trays
Page orientation
Sides: simplex/duplex handling
Print quality
Chromaticity: color/monochrom
Copies
Finishings
NumberUp, Imposition




Environment

Tested with
Win2K, FOP 0.20.5rc2, Java 1.4.2, JAI Image I/O Tools 1.0-rc, Batik-1.5

Compatibility
Images are handled by Image I/O, FOP's image handling is overridden.


Installation


install FOP, Java 1.4, Batik-1.5 and optionally JAI Image I/O Tools



copy file FOPjps.zip to disk



install printers

select national language versions so that font names match
set properties according to your needs




edit renderer configuration file

see description below
sample: rendercfg00.txt




edit printer configuration files

copy the printer names correctly from your list of printers
lookup attribute codes in Java source Print2DAttr.java
see description below
samples: prtcfgxx.txt




platform fonts other than "Helvetica", "Times",  "Courier", "serif", "sans-serif", "monospace":

generate font metrics
modify the FOP user configuration



run procedure


replace path names with your path names
set the national language option for your JVM so that font names match
sample: execSingle.bat, execMulti.bat



program: org.apache.fop.render.jps.Run2D

Use URL's: e.g. file:///C:...

arguments


argument 0: user configuration file
'single file formatting' or 'batch formatting'


single file formatting

preview: interactive mode

argument 1: xsl-fo input file
argument 2: renderer configuration file
argument 3: 'view' - viewer is launched


silent mode


arguments 3, 4, ...: An arguments for each output.
Tokens are separated by commas.

token 0: printer configuration file
optional token 1: [,destination = print file]



multiple FO files formatting


argument 1: 'controlfile', URL

URL: file containing lines same as 'formatting a single FO file' above



Renderer Configuration Files


// in colunm 1-2 comment
debugdisplay platform printer and font info, trace processing
SVGimageResolution=resolutionresolution: requested image resolution
adjustPrinterResolutionIf specified, the lowest resolution from (1200, 600, 300, 150, 72) fitting into the area is selected.
Otherwise the image is scaled to fit the area.

HelveticaMap=Arial
TimesMap=Times New Roman
CourierMap=Courier New
SymbolMap=Symbol
ZapfDingbatsMap=ZapfDingbats
Font maps, substitution for standard fonts. This applies also to
sans-serif --> Helvetica
serif --> Times
monospace --> Courier



Printer Configuration Files


// in colunm 1-2comment
copies=nn: numbers of copies
printer=printerNameprinterName: printer name, your platform knows
attributes=n1 n2 n3 n.: attribute code as specified in Java source Print2DAttr.java



Embedding RTF, HTML and TXT Documents


HTML 3.2 is supported. RTF about at the level of WordPad.
Additional pages are inserted: specify block break-before="page

AW: AW: Structure renderers & area trees (Re: startup refactoring)

2003-06-23 Thread J.U. Anderegg
> Bertrand Delacretaz wrote:
> ...
> > How do you plan to handle RTF styles?
>
> In jfor we defined an extension to XSL-FO (the "jfor-style" attribute)
> to control RTF styles.
>
> I think some form of extension is needed as (AFAIK) the concept of
> styles does not exist in XSL-FO, as it is meant for printed output.
>

(1) This is not a FOP extension, but rather a fundamental change of the
XSL-FO language, which does not know stlye sheets.

> Another way would be to recognize sets of attribute values in the input
> XSL-FO and map them to RTF styles.
>

(2) I wrote a few weeks ago this and it is still my idea, how FOP should
store properties:

"Apply the principles of relational databases to eliminate redundancies: set
up tables of unique/used fonts, strokes, colors, ...  and have the objects
reference table entries. This will cost table lookups, CPU. However, it will
also ease state processing. The program does not have to keep track of
inherited properties set 300 FO elements earlier. The nuisance is that style
sheets have acceptable redundancy (see DocBook), XSLT replicates properties
innumerable times and FOP has to recollect and normalize all this stuff."

My opinion:

(1) is off FOP territory
(2) to be considered, if FOP is implemented on this way

Hansuli Anderegg



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]



AW: Structure renderers & area trees (Re: startup refactoring)

2003-06-23 Thread J.U. Anderegg
> Bertrand Delacretaz wrote
> The whole point of the StructureHandler interface is to be able to 
> reuse FOP's "frontend" for structure-based renderers.
> The impact of StructureHandler on the "standard" FOP output formats 
> (PDF mostly) is minor, but it allows the FOP "pipeline" to branch 
> cleanly, after the parsing and attributes resolution, to generate 
> either structure-based or page-based formats.
> 

How do you plan to handle RTF styles?

Is it difficult to transform tables and lists?

Hansuli Anderegg


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]



AW: startup refactoring

2003-06-21 Thread J.U. Anderegg
A FOP renderer cannot support fonts. Physical devices, output systems do
this. But a FOP renderer may allow to map fonts and translate Unicode
characters to bytes using codepages. The user has to take care that font
metrics and it's character sets are accurate enough for all target devices
and better does not try to print Helvetica on a matrix printer or paint
color on a black/white laser printer.

Current FOP uses a mix of Adobe and Java font systems: less would be more.

Hansuli Anderegg



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]



AW: startup refactoring

2003-06-20 Thread J.U. Anderegg
The current FOP is not fit for i18n, directions, area orientations and does
not even support a dotted line. Renderes too. Design correct data objects in
the first place instead of fancy control mechanisms.
- what do pipelines look like?
- are there really pipelines or are partial document fragments passed on?
What's in memory at any time?

main
o initialize
o parse XSL
o layout pages
o render x times

initialize
o process config
output: global config objects
o get platform info
output: global platform objects

parse XSL
o process layout-master-sets, page-sequences
output: internal page description objects

o process flows
- standardize properties (measurements, property synonyms)
- resolve XSL inheritance to avoid tricky states, switches
- calculate FO dimensions as far as possible and transform
output content: to a suitable representation (my favorite: Graphics2D)
  output document stucture, areas: into FOTree with pointers to content
output unique property/attribute maps: memory savers

layout pages
o apply page descriptions to flows
o paginate: fill pages sequentially, split content objects
o resolve references
output: content objects supplemented with page coordinates on a
device-independent way
o baptize the result "Area Tree"

render
o process renderer configuration
o output content objects in a device-dependent format

Hansuli Anderegg



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]



AW: hack to avoid memory overflow with tables

2003-05-30 Thread J.U. Anderegg
> Glen Mazza wrote:
> FOP's goals should be (1) to be compliant/accurate with the spec

The Area Tree is an implementation specification: either the XSL editors
remove it from the specs or they specify it precisely as a portable,
device-independent print file format. I ran Chuck Paussa's FO schema thru
Castor. Anything goes and is formally valid.

> (2) be able to generate the largest numbers of huge files in the smallest
amount of time.

Is the design optimized for big DocBooks, accounting reports 15'000 uniform
pages long, many small business documents?

Reminder on renderer requirements:

o Data: basic draw objects (current FOP uses nothing else from the area
tree).
o Physical printers: pages in a sequential data stream
o AWT viewer: random access to pages
o PDF: finished pages may be shipped to the renderer, accepted page
references don't cause page break changes.

> To me, multiple layout strategies is
> really like saying multiple applications.  (After all,
> the layout handler and renderers *form* an XSL FO
> formatter.)

Is there a common agreement on FOP components, processing modes (push/pull),
intermediate data storage and the suitable interfaces?

An overall design given, plugins and multiple layout strategies can be
defined and evaluated. Most likely the findings will be: there is one layout
strategy. Playing with spacing and balancing, hyphenation is switched off on
demand. Plus some performance tips like: do not use forward page references,
auto-sized big tables, text columns ...

Hansuli Anderegg



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]



AW: AW: Thoughts on design - FO property expressions

2003-05-28 Thread J.U. Anderegg
> Peter B. West wrote:
>
> You seem to be familiar with some of the
> swing.javax.text classes.

Yes, as a user of these classes: no need to know internals.


> Can you sketch the approach out in a bit more
> detail?  Have you looked at percentages?
>

See a description javax.swing.text: Interface Document. There is HTML
support. Perhaps an evaluation of an XSL adaption makes sense.

Asap I will try to embed HTML into FOP documents and test your percentages.
If it works, find out how. If not, find out what HTML specifies on
percentages.




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]



A FOP Renderer based on Java Printing System and Grapics2D

2003-04-05 Thread J.U. Anderegg
The Java Printing System enables applications to:

- Print Java 2D™ graphics, text and images.
- Control document-composition functions such as soft collating, reverse
order printing, and booklet printing.
- Invoke printer-specific functions such as duplex (two-sided) printing and
stapling.
- Print on all platforms, including Windows and Solaris.
- Data stream generation by platform printer drivers.

My renderer, based on the Java Printing System and Graphics2D: pure Java
does a perfect job. I will send sources, classes, documentation on request
to my e-mail address.
__

Highlights

- Operation: silent or page/printer dialog
- direct printing or output to file
- Supported printers, data streams: PCL, AFP, Postscript, Text, PDF
(PDFWriter required)
- Precise output control by setting page/printer properties of drivers
- Several renderings per run
- Image Formats: JPEG, PNG, GIF (with JAI Image I/O Tools 1.0-rc also BMP,
TIF)
- SVG Support
- Controls per print job
o Destination file
o Media sizes, bins, trays
o Page orientation
o Sides: simplex/duplex handling
o Print quality
o Chromaticity: color/monochrom
o Copies
o Finishings
o NumberUp, Imposition
__

Test Environment

- Win2K
- FOP 0.20.5rc2
- Java 1.4.1
- JAI Image I/O Tools 1.0-rc
- Batik-1.5
__

Sample Printer Configuration:

// double-slash is comment

// debug: lists system printer and and fontinfo
debug

// silent: dont prompt page/printer dialog
silent

// destination: "print to file"
destination=file:///C:/fop-0.20.4rc/AnyExtensions/print2D.txt

//copies=1

// printer: select an installed printer
printer=hp psc 700 series
//printer=HP LaserJet 5M
//printer=HP LaserJet 4/4M PS
//printer=Generic / Text Only
//printer=Acrobat PDFWriter

// attributes: specify JPS attributes
// PORTRAIT=102 ISO_A4=414
attributes=102 414

// SVGimageResolution: the renderer has SVG rasterized to the available area
size at this resolution
SVGimageResolution=300

// adjustPrinterResolution: scale at resolutions 72 or 150 or 300 or 600 to
fit the available area most closely
adjustPrinterResolution

// map standard fonts to platform fonts
HelveticaMap=Arial
TimesMap=Times New Roman
CourierMap=Courier New



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]



SVG and Image "Caching" - Page Fore-/Backgrounds - Transparency

2003-01-24 Thread J.U. Anderegg
A couple of new functions to FOP's PDF rendering:

o SVG's and images as page fore-/backgrounds with transparency control
o SVG rendering as image
o Image resolution control by the user
o Caching on the PDF way: store/write a resource once - reuse it
o Open Actions

These add-ons are programmed as instream-foreign-object's by FOP extensions
and by adding code to the PDF renderer. They are outside of XSL-FO standards
and fully compatible with the present FOP.

Tested with: FOP 0.20.4, Java 1.4 and 1.3.1, Batik 1.5

Download: http://mypage.bluewin.ch/huanderegg

Hansuli Anderegg

==

o General structure of instream-foreign-object's

 
 



(FOP seems to require ""-elements. Who knows why?)

==

FOREGROUNDS AND BACKGROUNDS

o Specifying an SVG resource

 

- name: to reference a resource
- url:  of an (external) SVG or image file
- height: controls the presentation size of the resource. The viewbox of the
SVG is transformed to the given height with a proportionally sized width.
- points: all measurement are in points = inch/72
- imageResolution="dpi": if present, a JPEG image is created with the asked
resolution
- PDFfonts="yes": if present, PDF fonts are used - otherwise text is drawn
by graphics
_

o Specifying a JPEG image resource

 

- widthPix, heightPix: image size in pixels
_

o Specifying page foregrounds, backgrounds

 

- first, odd, even: use resource specified by nameReference for first, odd
or even document pages
- "background" or "foreground": resource is to be presented either in
background or foreground layer
- pointsX,pointsY: top/left corner page coordinates of background/foreground
- transparency: constant alpha with defined values "0.25" or "0.5" or "0.75"
or "1.0" (alpha blending simulates the opacity of celluloid layers: 1.0
indicates an opaque pixel, 0.0 indicates a transparent pixel )
_

o Resetting page foregrounds and backgrounds by setting nameReference to
"null"

 

_

o Rendering an SVG as image





- height: required, so that FOP allocates the space
- imageResolution: resolution control
--> current position(x,y) calculated by FOP formatting

==

VARIOUS EXTENSIONS

o Specifying a startup AcroScript

 app.beep(0); this.zoom =
200;

Enter any suitable AcroScript statements to set startup options,
preferences, menues etc. in the tag text,
_

o Turning on debugging messages

 

_

o and who programs?

 bookmark text

 
barcode data



SAMPLE INPUT









app.beep(0); this.zoom =
200;






















==



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




AW: PDF transforms (was: Re: File prefix again)

2002-12-23 Thread J.U. Anderegg
Hi Keiron,

> On Sun, 2002-12-22 at 02:18, Kevin O'Neill wrote:
> > Is the paged XML a new or existing format?
>
> A new format for now at least.
>
> It is possible there will be a w3c defined format.

Please give some pointer to w3c activities in this area. What is this thing
exactly supposed to do? What have externals to look like? etc...

Hansuli Anderegg



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




AW: Sun XSL Formatter

2002-12-18 Thread J.U. Anderegg
Whatever the motivation of Sun was, FOP has to be postitioned in the IT
world.

What runs in which environment? Which output types are supported?

- Adobe announced PDF support (in a Windows environment?)
- IBM announced AFP support in a Java environment
- Sun's XSL:FO supports PDF (in a UNIX or Windows environment?)
- FOP supports SEVERAL output types in a Java environment

Operation

- FOP: standalone batch, servlet

Extensibility = features not defined by XSL:FO, e.g. renderers, bookmarks,
barcodes, SVG

Optimized document types: big books vs. business forms/outputs

Only when the design and details of the Sun XSL Formatter will be known,
consequences for FOP may be discussed on a productive way.


Hansuli Anderegg



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




AW: Disable save button in acrobat reader

2002-12-12 Thread J.U. Anderegg
> Gorka Echevarría wrote:
>
>  > Anybody knows how can I disable the save button on Acrobat Reader?

Ask this question in a PDF forum!

The next question will be: is FOP able to output PDF documents with the
required properties? I guess AcroScripts will do the job.

Hansuli Anderegg



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




New: AFP Renderer / Batch Assembler for FOP

2002-12-07 Thread J.U. Anderegg
For details see:

see http://mypage.bluewin.ch/huanderegg

Topics of general interest:

- use of Jeremias Maerki's extension sample: for PDF bookmarks, JavaScripts,
barcodes?
- Java Image I/O
- decoupling the renderer

Hansuli Anderegg



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




AW: Form XObject (was: Re: Avalonization?)

2002-11-12 Thread J.U. Anderegg
> On Tue, 2002-11-12 at 12:00, Kevin O'Neill wrote:
> > > I just added a Form XObject but it needs some work (eg. bounds).
> >
> > How do you intend to pass xobject hits from the fo processor. I had
> > thought about a fop specific attribute that was a hint on block level
> > objects.

What does your xsl:fo input look like? Standard xsl:fo according to specs?

> Von: Keiron Liddle [mailto:keiron@;aftexsw.com]>
I'm not sure what situation you might be talking about. So to speculate:
> If it is to use xobject when there are things repeated across pages
> (static areas, table header, svg) then it could be done through the
> layout managers. If the content may be repeated and does not depend on
> the page then it could set a value on the area tree saying that the area
> (and contents) should be placed in a xobject. When the same area occurs
> again, indicated by a key or something, then it will render the xobject
> again.
>

What do PDF XObjects, Bookmarks, form fields have to do in the area tree?
How about device independence? How will the PCL and AWT renderers process
XObjects?

A layered distiction between the jobs of a (device independent) fo formatter
and the renderers (generation of device dependent graphic streams, caching,
ressource management) will keep the system maintainable. This can be
achieved by instream-foreign-objects: the fo proscessor calculates page
numbers/positions, reserves presentation spaces and passes foreign-object
contents/control unchanged and unchecked to renderers.

Hansuli Anderegg



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




AW: [RT] Proprietary extension to fo:external-graphic

2002-11-08 Thread J.U. Anderegg
Considering PDF only, I see prefabricated image XObjects as a very powerful
feature.

Extracting image XObjects from PDF files and storing them for use by the
renderer brings two advantages:

a) saves CPU and memory at a maximum

b) the user controls image representation/handling in PDFs.

Writing an extract program and progamming the renderer is straightforward,
caching is solved for PDF. Remains to tell FOP how to handle these
external-graphics.

Hansuli Anderegg

Sample image XObject to be inserted into PDF file by PDF renderer

21 0 obj <<<=== adjust PDF object ID
<>
stream
GarT@B


fo:external-graphic in PDF

2002-11-06 Thread J.U. Anderegg
This is how it used to work:

o anywhere in FOP formatting

- load image, if same URL was not loaded before and find out the space
needed for the image.
- keep list of processed files.

o PDF Renderer:

- generate XObject, if XObject of same URL was not generated before. Delete
image buffer: partial image cleanup only?
- keep list of generated XObjects.
- reference/reuse the XObject as often as required in content streams,
scaled to different sizes

A simple design:

o FOP formatting determines space needed = partial reading of image files
o Renderers control image processing according to their needs. The PDF
renderer does not need any caching: maximum 1 image in memory at a time.
- additional attributes for external-graphic might be helpful, e.g.
resolution, color model
- Isolation image processing in renderers will solve SVG caching more
easily.

Hansuli Anderegg



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




AW: storing metadata

2002-10-28 Thread J.U. Anderegg
Hi Paul,

this is how Acrobat embeds files. Follow the indirect PDF object references:

5 0 obj
<<
/Pages 2 0 R
/Type /Catalog
/Metadata 19 0 R
/Names 17 0 R <<<--- add this entry
>>
endobj

17 0 obj <<<--- add this object
<<
/EmbeddedFiles 18 0 R
>>
endobj

18 0 obj <<<--- add this object
<<
/Names [ (?y M y D a t a)14 0 R ] <<<--- relate internal name to file object
>>
endobj

14 0 obj <<<--- add this file object
<<
/F (eink03.txt)
/Type /F
/EF << /F 15 0 R >>  <<<--- file content reference
>>
endobj

15 0 obj <<<--- add file content
<< /Filter [ /FlateDecode ] /Length 1913 /Type /EmbeddedFile /Params <<
/CheckSum <0a9b1bb2b166ecefaaf4a9e028e70567>/Size 9296 /CreationDate
(D:20020326101325)
/ModDate (D:20020326101330)>>
/Subtype /text#2Fplain >>
stream
H??WM?$5??4y!/}a???8O
...
endstream
endobj

Question: why storing XSL:FO instead of XML + XSL - having the user edit XML
data and FOP reformat, repaginate the document?

Hansuli Anderegg
__

Metadata look like this:


19 0 obj
<< /Type /Metadata /Subtype /XML /Length 1311 >>
stream




 
  Dokument - WordPad
  2002-10-28T14:03:58Z
  Dokument
  Administrator
  Acrobat PDFWriter 5.0 for Windows NT
  2002-10-28T14:08:28+01:00
 

 
  2002-10-28T14:03:58Z
  
   
Dokument
   
  
  Administrator
  2002-10-28T14:08:28+01:00
  2002-10-28T14:08:28+01:00
 

 
  Dokument
  Administrator
 



endstream
endobj



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




AW: storing metadata

2002-10-24 Thread J.U. Anderegg
Hi Paul,

Do you want to embed the XSL:FO input in the PDF document?

If this is so:
o "embedding files in PDF" is the thing to do, but quite a challenge to
build into the PDF renderer.
o out of pure curiosity: why?

Hansuli Anderegg



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




AW: BARCODE

2002-10-09 Thread J.U. Anderegg

Why not a fast, flexible and reliable solution? 3 things are needed:

o Java routines to calculate barcode rectangles and label areas depending
from barcode type and its parameters. Possibly such routines are freely
available. Otherwise: give me the specs, I will write the code (the nowadays
popular datamatrix will be harder) and somebody has to run scan tests.

o Java code to render the rectangles: very easy in PDF

o Handy XSL:FO Input. My experimental hack below is functionally OK allowing
barcode type selection with appropriate parameters. The renderer extensions
is quite easy and elegant.


Hansuli Anderegg
__

Barcode Input




content: bar3of9, D014679, 60.0, 600.0, 18.0, 1.44,
2.25
 ||| |  | | |
 ||| |  | | + 
ration narrow/wide
 ||| |  | + module 
width
 ||| |  + height
 ||| + y position
 ||+ x position
 |+ barcode data
 + barcode type







-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




AW: PDF Impositioning

2002-08-15 Thread J.U. Anderegg

Hi Kevin,

Reference XObjects

Acrobat Readers by Adobe do not support reference XObjects - Acrobat
neither.


Imposition

o What do you exactly want to program? I suppose a kind of "preprinted
form". Imposition in the printing industry is something else - at least in
German.

o What is the external interface in XSL:FO? How will you catch this stuff in
the renderer?


Hansuli Anderegg

P.S. PDF versions: viewers are generally backwards compatible: a viewer
processing PDF 1.4 is also able to handle PDF 1.3. But if a PDF file is
labelled 1.4 it has to be exact 1.4, because there may changes from release
to release.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




AW: Tasks - layout

2002-08-12 Thread J.U. Anderegg

o Are there specified packages, classes to be programmed? Are the
interfaces/interface objects specified?
o Are prerequisite packages or test drivers available?
o Are the basic formatting rules documented: how are (collapsing) borders,
margins, spaces added and adjusted in area calculations,passed to renderers?

> As far as I know there is never a case where a finished page should be
> redone. Once a page is complete that is it.
> Those problems should be solved during the layout of a page only and not
> considering furture pages.

and if you have a TOC at the begin of a document, "see page 967" on page 3
("967" unresolved at formatting time of page 3)? Are optimal/maximal/minimal
space, floats, footnotes, keeps, table breaks adequately handled without
lookahead and backtracking, multiple formatting passes?

Hansuli Anderegg



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




AW: Adding Arial font support

2002-08-01 Thread J.U. Anderegg

from PDF Reference p.319

Standard Type 1 Fonts

The PostScript names of 14 Type 1 fonts, known as the standard fonts, are as
follows:

1  Helvetica"Sans-Serif"
2  Helvetica?Bold
3  Helvetica?Oblique
4  Helvetica?BoldOblique
5  Times?Roman  "Serif"
6  Times?Bold
7  Times?Italic
8  Times?BoldItalic
9  Courier  "MonoSpaced
10 Courier?Bold
11 Courier?Oblique
12 Courier?BoldOblique
"Symbol"
13 Symbol
14 ZapfDingbats

These fonts, or their font metrics and suitable substitution fonts, are
guaranteed
to be available to the viewer application.

+-+-+--+
-+
| Postscript Fonts  |  XSL:FO properties
|| |
+-+-+--+
-+
| F1  |Helvetica|  "Helvetica" | "sans-serif", "normal",
"normal"|
| F2  |HelveticaOblique |  "Helvetica" | "sans-serif", "oblique",
"normal"   |
| | |  "Helvetica" | "sans-serif", "italic",
"normal"|
| F3  |HelveticaBold|  "Helvetica" | "sans-serif", "normal",
"bold"  |
| F4  |HelveticaBoldOblique |  "Helvetica" | "sans-serif", "oblique",
"bold" |
| | |  "Helvetica" | "sans-serif", "italic",
"bold"  |
| F5  |TimesRoman   |  "Times" | "serif", "normal", "normal"
|
| F6  |TimesItalic  |  "Times" | "serif", "oblique",
"normal"|
| | |  "Times" | "serif", "italic", "normal"
|
| F7  |TimesBold|  "Times" | "serif", "normal", "bold"
|
| F8  |TimesBoldItalic  |  "Times" | "serif", "oblique", "bold"
|
| | |  "Times" | "serif", "italic", "bold"
|
| F9  |Courier  |  "Courier| "monospace", "normal",
"normal" |
| F10 |CourierOblique   |  "Courier| "monospace", "oblique",
"normal"|
| | |  "Courier| "monospace", "italic",
"normal" |
| F11 |CourierBold  |  "Courier| "monospace", "normal",
"bold"   |
| F12 |CourierBoldOblique   |  "Courier| "monospace", "oblique",
"bold"  |
| | |  "Courier| "monospace", "italic",
"bold"   |
| F13 |Symbol   |  "Symbol"|
|
| F14 |ZapfDingbats |  "ZapfDingbats"  |
|
+-+-+--+
-+


__


from PDF Reference p.319


Table H.3 shows the complete list of font names that are accepted as the
names of standard fonts. In each group, the ?rst name (for example,
Helvetica) is the proper one; the others (Arial, ArialMT) are alternatives.

TABLE H.3 Names of standard fonts

Times?Roman Helvetica   Courier
TimesNewRoman   Arial   CourierNew
TimesNewRomanPS ArialMT CourierNewPSMT
TimesNewRomanPSMT

Times?Bold  Helvetica?Bold  Courier?Bold
TimesNewRoman?Bold  Helvetica,Bold  Courier,Bold
TimesNewRoman,Bold  Arial?Bold  CourierNew?Bold
TimesNewRomanPS?BoldArial,Bold  CourierNew,Bold
TimesNewRomanPS?BoldMT  Arial?BoldMTCourierNewPS?BoldMT

Times?ItalicHelvetica?Oblique   Courier?Oblique
TimesNewRoman?ItalicHelvetica?ItalicCourier,Italic
TimesNewRoman,ItalicHelvetica,ItalicCourierNew?Italic
TimesNewRomanPS?Italic  Arial?ItalicCourierNew,Italic
TimesNewRomanPS?ItalicMTArial,ItalicCourierNewPS?ItalicMT
Arial?ItalicMT

Times?BoldItalicHelvetica?BoldOblique   Courier?BoldOblique
TimesNewRoman?BoldItalicHelvetica?BoldItalicCourier,BoldItalic
TimesNewRoman,BoldItalicHelvetica,BoldItalicCourierNew?BoldItalic
TimesNewRomanPS?BoldItalic  Arial?BoldItalicCourierNew,BoldItalic
TimesNewRomanPS?BoldItalicMTArial,BoldItalic
CourierNewPS?BoldItalicMT
Arial?BoldItalicMT

Symbol  ZapfDingbats


__

Conclusion: just use standard fonts unless you are going for a beauty
contest.

Hansuli Anderegg



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




AW: FO to RTF, Java Viewer: request for a systematic approach

2002-07-29 Thread J.U. Anderegg

Step 1: Specify what has to be done!

What are the requirements? What has to be supported? Which operating
environments? I'm afraid there is no common understanding, i.e. a fairly
precise specification in a few sentences, for these recent examples below.


Step 2: How can the specified requirements be implemented?

Look for and investigate candidate solutions!


Step 3: Which is the most reasonable candidate solution?

Evaluate candidate solutions and all their consequences! Select the most
appropriate one!


Step 4: Implementation

Contributors take over the job with a solid background.
_

RTF

1. Requirements:
- generate revisable documents from XML data, preferably RTF?
- support images, graphics, indices, TOC's, tables, viewing/printing?


2 Candidate solutions

2.1 FOP

2.2 XSLT


3. Evaluation

3.1 FOP

This is the RTF text of a very simple RTF document:

{\rtf1\ansi\ansicpg1252\deff0\deflang1031{\fonttbl{\f0\fswiss\fcharset0
Arial;}}
\viewkind4\uc1\pard\f0\fs20 paragraph 1 and text\par
\par
paragraph 2 and text\par
\par
\par
}

The first line is some declarations (character set, font f0), followed by
next lines containing the document text.

What is FOP supposed to do? The structure is fundamentally different from
XSL:FO without any kind of declarations ("style sheets"). We do not see any
page coordinates, pagination controls.

3.2 XSLT

RTF text can be generated by XSLT. An infrastructure organisation of "XSLT
stylesheets" is needed to generate "RTF stylesheets".

_

Java Viewer

1. Requirement
- Display XSL:FO documents in a Swing/AWT window? PDF?
- Support: view/print, images, graphics?


2 Candidate solutions

2.1 AWT Renderer

2.2 Acrobat Reader

2.3 Java PDF Viewer

2.4 Java SVG Viewer


3. Evaluation

3.1 AWT

What's wrong with the AWT renderer: are there just programming errors or
were system limitations hit?

3.2 Acrobat Reader

Acrobat Reader is THE full function PDF viewer. Is there a way to run
Acrobat Reader in a Java window: Mozilla, OLE by Java, ...?

3.3 Java PDF Viewer

Pretty hard to develop a full function viewer.

3.4 Java SVG Viewer

Is code available? If yes, image handling is to be solved.
_


These examples are just meant to explane my request. Similar considerations
apply to FOP extensions. Only a systematic approach will allow efficent
development and evolution of FOP.

_

Hansuli Anderegg



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




AW: OutofMemoryException

2002-07-25 Thread J.U. Anderegg

To attack the problem:

o split the job into 2 steps:
- XSL transformation writes XSL:FO to a file
- FOP formats the file

o use another renderer: text e.g.

o vary the input
- reduce the volume: when does it blow up?
- eliminate distinct elements

You will pretty soon see the source of the troubles.  


Hansuli Anderegg



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




AW: PDF output driver

2002-07-24 Thread J.U. Anderegg

Let's talk component software (or blame monolithic MicrosSoft)!

- Formatting has to be separated strictly from rendering
o A clean and stable interface has to be defined (why not by data
representations of powerful PDF?)
o The renderer has to control the processing sequence.

- FOP does what the XSL:FO specs say - no more and no less:
o external-graphics are not really specified in XSL:FO, so let additional
attributes pass and let the renderer do the job.
o foreign-object is by chance SVG: let foreign be foreign and pass
foreign-object's without checks thru to the renderer.

The area of contributors and hackers is renderers and foreign-objects, so
that the FOP core can be kept clean and preserved from release dependencies
(Batik, JAI etc.)

Hansuli Anderegg, Zurich





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




AW: FO to RTF

2002-07-24 Thread J.U. Anderegg

Rendering RTF from the FOP area tree will produce a document edited without
template (.dot).

RTF is a revisable format - not a formatted document format. XSL:FO is an
extensive formatting language without any kind document elements (like
Adobe's e-Book), macros or stylesheets in the original meaning. Have a look
at Microsoft's Office XML and you will  see incompatible concepts. RTF
generation has to happen at the XSLT layer.

Hansuli Anderegg, Zurich





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




AW: AW: [REDESIGN] pdf changes

2002-07-03 Thread J.U. Anderegg

XREF

PDF objects have to be written PHYSICALLY in ascending sequence of the PDF
object ID's. This is a requirement of the present XREF handling. If tis
condition is fulfilled and PDF syntax is correct, there is most likely a
length in error.


Page viewport in PDF is the /Cropbox

Cropbox:
x = left page marging
y = bottom page margin
width = page size - left margin - right margin
height = page height - top margin - bottom margin

o The page margins have to be passed to the renderer.
o Coordinates are relative to the crop box (to be checked): the renderer has
to adjust.

Hansuli Anderegg, Zurich



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




AW: [REDESIGN] pdf changes

2002-07-02 Thread J.U. Anderegg

Keiron wrote:

>- added transparency for shapes and alpha mask for images

well, what has to be transparent? Background images or overlaying text?
- 82 pages: Transparency in PDF, Technical Note #5407, Adobe Developer
Technologies

>- Outputs pdf objects immediately
>Unortunately I have broken the xref table and I can't figure out what is
wrong.

The XREF is built incrementally in parallel to file writing. So your PDF
object has to wait, until it is it's turn to output to the file.

Example: image xObject on page in PDFRenderer

- create xObject: say PDF object ID 27
- add xObject to page objects
- output page objects: method "toPDF" of objects say 20-30 is invoked
. object 27: do the data/processing intensive things at this time

If you send me the code, I can figure out what the problem is.

Hansuli Anderegg, Zurich



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




PDF Images by Java Advanced Imaging

2002-06-29 Thread J.U. Anderegg

Inputs
o BMP, GIF, TIF, JPG, FPX, PNM
o SVG instream and external file

Output
o JPEG (Acrobat Reader interprets the complete image file within a PDF file
= no transformation = no lossy info loss)

Features
o colors: RGB, Gray, CMYK
o svg, image processing isolated in renderer XObject class
o little memory requirements
o process and store images and external SVG once in PDF - redisplay them in
various sizes many times
o parameter passing to the rrenderer

XSL:FO interface
By svg  in order to parametrize PDF generation. If FOP let
instream-foreign-objects be foreign without touching them, outlines, form
fields, JavaScripts can be implemented by meaningful XML allowing
unrestricted, safe extension contributions.

The challenge
o Handling layout size of images and svg's.
o Java Advanced Imaging transforms images at load time, properties of the
orignal image are distorted. Programming against the codec's might solve
this problem.
o Given correct properties: how to generate the precise PDF dictionary
entries. For JPEG not too difficult, but other formats?

Software
o JRE 1.3
o Java Advanced Imaging 1.1


Hansuli Anderegg



http://www.w3.org/1999/XSL/Format"; xmlns:svg="http://www.w3.org/2000/svg";>











1. FOP image test

	

text: startup Javascript
	
		 startup,yes,no
			<< /S /JavaScript /JS (app.beep(0)
this.zoom = 200;) >>
			
		
  	
	



A JPEG image in FOP
  

	
		img,c:/HU/alt/Fop-0.20.1/docs/graphics/fop.jpg,1.0,fromImage
 	

  


JPEG size changed

  

	
		img,c:/HU/alt/Fop-0.20.1/docs/graphics/fop.jpg,.80,fromImage
 	

  


A PNG image in FOP

  

	
		img,c:/HU/alt/Fop-0.20.1/docs/graphics/boat.png,.80,fromImage
 	

  


an other png

  

	
		img,c:/HU/alt/Fop-0.20.1/docs/graphics/BorderCommonStyle.png,.80,fromImage
 	

  


SVG

 
 
 
  
  
  
  SVG placed in a block
  
  



SVG size changed

 
 
 
  
  
  
  SVG placed in a block
  
  


  
SVG external
  

	
		svg,c:/HU/alt/Fop-0.20.1/docs/graphics/boxes.svg,1.0
 	

  
  
SVG external size changed
  

	
		svg,c:/HU/alt/Fop-0.20.1/docs/graphics/boxes.svg,1.0
 	

  

  
BMP image
  

	
		img,c:/HU/alt/Fop-0.20.1/docs/graphics/linux.bmp,.80,fromImage
 	

  
  
BMP reused, size changed
  

	
		img,c:/HU/alt/Fop-0.20.1/docs/graphics/linux.bmp,.80,fromImage
 	

  

  
TIFF image
  

	
		img,c:/HU/alt/Fop-0.20.1/docs/graphics/dario.tif,.80,fromImage
 	

  
  
TIFF reused, size changed
  

	
		img,c:/HU/alt/Fop-0.20.1/docs/graphics/dario.tif,.80,fromImage
 	

  

  

GIF
  

	
		img,c:/HU/alt/Fop-0.20.1/docs/graphics/page.gif,.80,fromImage
 	

  

  
GIF  reused, size changed
  

	
		img,c:/HU/alt/Fop-0.20.1/docs/graphics/page.gif,.80,fromImage
 	

  

  
JPEG big
  

	
		img,c:/HU/alt/Fop-0.20.1/docs/graphics/muehle.jpg,.80,fromImage
 	

  


the same in gray 256
  

	
		img,c:/HU/alt/Fop-0.20.1/docs/graphics/fop_gray.jpg,1.0,fromImage
 	

  

  
Test color rgb
  

	
		img,c:/HU/alt/Fop-0.20.1/docs/graphics/RGB.jpg,1.0,/DeviceRGB
 	

  
  
Test color cmyk
  

	
		img,c:/HU/alt/Fop-0.20.1/docs/graphics/CMYK.jpg,1.0,/DeviceCMYK /Decode [1.0 0.0 1.0 0.0 1.0 0.0 1.0 0.0]
 	

  

  
GIF transparent image: not supported by JPEG, color indexed
  

	
		img,c:/HU/alt/Fop-0.20.1/docs/graphics/xml_feather_transparent.gif,.80,/DeviceCMYK
 	

  


  
  This section is only required to show that the layout still works.

-->




	  


PDFXObject.java
Description: Binary data

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]


AW: image support (was: RE: Fop and JDK1.2 (using ant copy tasks toselect implementations))

2002-06-13 Thread J.U. Anderegg

The good library is here: Java Advanced Imaging. In a few days I will have a
sample PDF renderer using it.

o BMP, GIF, TIF, JPG, FPX, PNM and SVG are processed.
o Immediate file operations: 1 image in memory at a time
o caching, reuse by PDF features


Hansuli Anderegg



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




AW: Antw: AW: printing the correct document

2002-06-10 Thread J.U. Anderegg

Copy from Adobe Knowledge Base:


PDF File Prints Off-Center to HP 1120c, Epson Stylus 860, and Epson Stylus
656

Issue
When you print a PDF file from an Adobe Acrobat 4.0 or later product (such
as Acrobat or Acrobat Reader) to a Hewlett-Packard (HP) 1120c printer, an
Epson Stylus 860 printer, or an Epson Stylus 656 printer, the resulting page
is off-center by 1/8" to 1/4".


Solution

Print to a PostScript printer.


Additional Information

Acrobat products may not print correctly to HP DeskJet 1120c, Epson Stylus
860, and Epson Stylus 656 printers.


_


Copy from HP PSC 750 help: HP printers have unprintable margins.


Papier
ObenUnten   LinksRechts
US Letter   1,8 mm  11,7 mm 6,4 mm  6,4 mm
US Legal1,8 mm  11,7 mm 6,4 mm  6,4 mm
US Executive1,8 mm  11,7 mm 6,4 mm  6,4 mm
ISO A4  1,8 mm  11,7 mm 3,4 mm  3,4 mm
ISO A5  1,8 mm  11,7 mm 3,4 mm  3,4 mm
JIS B5  1,8 mm  11,7 mm 3,4 mm  3,4 mm
Briefumschläge

US Nr. 10   3,2 mm  11,7 mm 3,2 mm  3,2 mm
A2 (5,5 quadratisch)3,2 mm  11,7 mm 3,2 mm  3,2 mm
Intnl. DL   3,2 mm  11,7 mm 3,2 mm  3,2 mm
Intnl. C6   3,2 mm  11,7 mm 3,2 mm  3,2 mm
Karten

US 3 x 8"   1,8 mm  11,7 mm 3,2 mm  3,2 mm
US 4 x 6"   1,8 mm  11,7 mm 3,2 mm  3,2 mm
US 5 x 8"   1,8 mm  11,7 mm 3,2 mm  3,2 mm
ISO und JIS A6  1,8 mm  11,7 mm 3,2 mm  3,2 mm
Hagaki  1,8 mm  11,7 mm 3,2 mm  3,2 mm


_

That's the way it is. Try to define a page size reduced by the unprintable
margins and use the remaining space fully:



Who knows what happens if you use endless paper?

Hansuli Anderegg



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




AW: printing the correct document

2002-06-08 Thread J.U. Anderegg

Guten Tag,

schicken Sie mir die Input xsl:fo? Dann kann ich den Fall einmal anschauen.

Mit freundlichen Gruessen
Hansuli Anderegg
Tel. 01-381-0207




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Renderer Analysis

2002-06-08 Thread J.U. Anderegg

In order to learn the page geometry I built a trace into the PDFRenderer.
Then I found that SVG can be written easily at the trace points. An analysis
of the results follows.



Coordinates (o) received by the renderer: PDF with origin left/bottom

PDF
Rectangle
|||
|||
||+---
|o
+-

Line
+---
o-
+-

Coordinates used by SVG with origin left/top

Rectangle
o-
|+
||+---
|||
|||

Line
o---
|-
+-

_

Text Block

o There is a hidden overpainting priority: last one in time sequence wins

   The blue background rectangle

FilledRect


o FOP sends a negative height with corresponding reference coordinates: not
suppported by SVG

   Borders

FilledRect

FilledRect
--> 
FilledRect

FilledRect


o Painted by 4 rectangles
o Left border is shifted out into the left margin -->

   o Shipping borders as filled rectangles
- prevents correct SVG positioning
- dotted, dashed borders (anyway no properties available at present)

   Text

linked_to
text2
inline
text2



An Image

renderImage URL
file:C:/HU/alt/Fop-0.20.1/docs/graphics/fop.jpg


o Reference coordinates top/left
o How big is an image given pixels/lines and rows without resolution? The
formatter has to know the extent of the image and no more.
o The renderer has to handle various image formats and cache images if
needed at all.
o As a courtesy the formatter can determine image formats and some image
properties as a common task, e.g.
- pixels/lines and rows to allow a proportional scaling
- color model
- compression
o Java 1.4's Advanced Imaging and Image I/O will allow a comfortable
programming
o If the basics of image and PDF are known, image processing is a file
copy.



The Internal Link

   First comes the text

before_link
internal_link
after_link


   and much later the link out of context


o This is PDF principle of operation: OK, if device/format independence is
no goal of FOP



Foreign Object: SVG



o At present Foreign Object = SVG.
o The renderer can have it transcoded by Batik into a JPEG: about a dozen
statements.
o Transcoder parameters: customization by compiling a Java class?
o Postprocessing like an image.
o The formatter has to know the extent of the object and no more.



o PDF rendering happens at about 6 trace points. PDFRenderer has lots of
unused code.

o A precise page geometry has to be calculated by the formatter: spaces,
(collapsing) borders, padding.

o Know the features of PDF and Java: correct graphic object (line,
rectangle, PDF path and stroke), caching, ressource management.

A formatter formats and a renderer renders. A strict separation is desirable
(keyword: device independence)- very few mutual imports. The formatter needs
only area dimensions and has to pass data to the renderer instead of
controlling and pushing it. xsl:fo input has to be setup, so that the
formatter just has to process text. No digging into other object types -
though they might have to be defined.

Ideally the renderer pulls the data in the sequence which it likes, so that
it does not have to save and manage data intermediately in memory.
Processing presentation objects is the job of the renderer. FOP is just
sequential batch processing in a few steps: why handlers, user agents,
windowing code?


Hansuli Anderegg



rend01.pdf
Description: Adobe PDF document



http://www.w3.org/1999/XSL/Format"; xmlns:svg="http://www.w3.org/2000/svg";>

  

  
  
  

  
  


  
 linked_to text2
 
   		 inline
   		 
		 text2	
  






before_link
internal_link
after_link







  
 
 
  
SVG placed in a block



 
   

<>

rend01.svg
Description: image/svg

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]


PDF Tests

2002-06-05 Thread J.U. Anderegg

View the PDF document with a Browser, e.g Internet Explorer. Keep it open
during your test session and reload the file when a new document version is
written. There are no file locking/sharing problems, no need to change file
names. I suppose print fidelity is kept.

Hansuli Anderegg



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




AW: Running Prefligh PDF tools on PDF files produced by FOP

2002-05-28 Thread J.U. Anderegg

Matthew Brook O'Donnell schrieb:
>>
>> cause a 'fatal PDF error' in PitStop, even without the modification
>> of (_data.size() + 1) to _data.size() in the PDFStream class that Hansuli
>> proposed.
>>
>> However, I haven't been able to produce PDF that pass with 0.20.3 (even
with
>> the proposed patch).

[..]

>> Were there significant change in the PDF output classes between 0.20.2
and
<> 0.20.3?

>As already mentioned the following bug sounds suspect:
 Christian

It is this bug: inserts of "Tc" into the PDF stream

Hansuli Anderegg





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




AW: AW: PS Renderer patch

2002-05-28 Thread J.U. Anderegg

Jeremias Maerki wrote:

I wonder. What exactly would you like to tell us with this mail? I don't
get it.

> The coordinates x/y have to be defined: outer, inner, center of the border
> line?

How does a renderer programmer know what coordinate parameters stand for
exactly? Most likely he will print a PDF document and his own document, put
two sheets one above each other, look at a window glass how lines match and
fit. Then he has to figure out how coordinates are to be handled.

If he has bad luck the printer driver will shrink one of the outputs to fit
the page.

Does this sentence hold?
"The print renderer delivers PDF coordinates and measurements for text,
lines, rectangles etc."


Hansuli Anderegg



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




AW: PS Renderer patch

2002-05-26 Thread J.U. Anderegg

The coordinates x/y have to be defined: outer, inner, center of the border
line?

PDF renderer FOP-0.20.1

o draws a box with 4 filled rectangles - each border line is a filled
rectangle. The SVG trace below demonstrates this.

o 4 calls to method addFilledRect(int x, int y, int w, int h, PDFPathPaint
fill) in PDFRenderer


(x,y) is the center of the line

border height = 3
---center (y for horizontal line)


Other renderers might have to operate with (y +- h/2), (x +- w/2)


http://www.w3.org/2000/svg";>






Hansuli Anderegg



tables.pdf
Description: Adobe PDF document


http://www.w3.org/1999/XSL/Format"; xmlns:src="UBSXMLSrc">










/




table border - cell padding, border








cell 1.1


cell 1.2


cell 1.3




cell 2.1


cell 2.2


cell 2.3




cell 3.1


cell 3.2


cell 3.3






table border, padding top/bottom - cell padding, border








cell 1.1


cell 1.2


cell 1.3




cell 2.1


cell 2.2


cell 2.3




cell 3.1


cell 3.2


cell 3.3






table border, padding left/right - cell border








cell 1.1


cell 1.2


cell 1.3




cell 2.1


cell 2.2


cell 2.3




cell 3.1


cell 3.2


cell 3.3






table border - cell 0








cell 1.1


cell 1.2


cell 1.3




cell 2.1


cell 2.2


cell 2.3




cell 3.1


cell 3.2


cell 3.3






table 0 - cell border








cell 1.1


cell 1.2


cell 1.3




cell 2.1


cell 2.2


cell 2.3




cell 3.1


cell 3.2


cell 3.3






table borders - cell borders dependent from position








cell 1.1


cell 1.2


cell 1.3




cell 2.1


cell 2.2


cell 2.3




cell 3.1


cell 3.2


cell 3.3











-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]


AW: Running Prefligh PDF tools on PDF files produced by FOP

2002-05-24 Thread J.U. Anderegg

The /Length below tells the length of the stream: it's 104 bytes and not
105.

I made a patch: is the attached PDF OK? Please check!

class: PDFStream
method: output(OutputStream stream): Why is 1 added? Is it correct under
other circumstances?
old code: write (_data.size() + 1)
new code: write _data.size()


5 0 obj
<< /Length 105 /Filter [ /ASCII85Decode /FlateDecode ]
 >>
stream
Garg^iR2p...
endstream



Hansuli Anderegg





crash01.pdf
Description: Adobe PDF document



http://www.w3.org/1999/XSL/Format";>

	
	
		
			
			
			
		
	
	

	
	

	
	
	

	
	
	hello world
	
	
	
	
	



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]


AW: Running Prefligh PDF tools on PDF files produced by FOP

2002-05-24 Thread J.U. Anderegg

Matt, Matthew,

can you send me a sample doc in error - as small as possible? I will have a
look at it.

Hansuli Anderegg



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




AW: diffs for on-the-fly image support

2002-05-21 Thread J.U. Anderegg

Inserting JPEG into a PDF file is a simple file copy - given the URI,
bits/pixel and color model. The latter are coded within JPEG files. PDF
stores the image once and allows multiple references to it. Is programmed
caching superior to the caching of the file system?

>From PDF view, memory = (JPEG file size + PDF encoded image) is needed at
most during the lifetime of an output page in memory. Why isn't that so:
device independence, AWT compatibility?

Similar considerations apply to GIF, TIFF and Fax formats.

Hansuli Anderegg



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




AW: direct rendering of images to pdf

2002-05-16 Thread J.U. Anderegg

These notes apply to  under FOP 0.20.1:

o FOP images are kept as XObjects until the end of job, because
- the image is written to the output file
- and the complete image object is added to the XObjects vector in order to
build the ressource dictionary at the end of the PDF document.

But the ressource dictionary needs only PDF object references - not the
images themselves. So if the addImage-method of PDFDocument-class is changed
like this, only images within a page are kept in memory.

old code:  this.xObjects.add(xObject);
   this.xObjectsMap.put(url, xObject);   deleted: does not hurt,
because never written

new code:  this.xObjects.addElement(new PDFXObject(this.objectcount,
this.xObjectCount)); // just adding an object ID as reference does it

Still memory usage rises from start to end of job: most likely FOP images
hang forever uncompressed in the area tree.

Hansuli Anderegg



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




AW: AW: Latest FOP schema

2002-05-13 Thread J.U. Anderegg

J. Pietschmann wrote:

 are

> Rectangular areas, perhaps indented and with border, padding
> and other individual traits, nested into a rectangular area.

I understand setting traits, properties. How about page layout, setting
inline and baseline postitions? Does it imply a unconditional CRLF?

What does the input below look look like on the page?


level_0_text fills to position A

level_1_text positioned at A fills to position B

more level_0_text positioned at B


Hansuli Anderegg



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




AW: Latest FOP schema

2002-05-11 Thread J.U. Anderegg

>From the external view  means a rectangle containing formatted text,
something like a paragraph.

o What do  as children of : mean for the end user?
o What's teheffect of 's in combination with tag element TEXT like
, , , , ?
o When is a  required?



Hansuli Anderegg




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Tables: padding and borders

2002-05-07 Thread J.U. Anderegg

Tests with FOP 0.20.1 and PDF output:

o Cells
- Define a rectangle with geometric lines as sides: width = 0.
- Padding on the cell element offsets text within the cell rectangle.
- Border rectangles are centered over the sides of the cell rectangle.
Adjacent cells put both centered border rectangles on common side lines.

o Tables
- Borders are built around the cells, when cells are already formatted and
fixed to a page position.
- Padding on the table element shifts the table border (not the table
itself relative to the parent) - e.g. out into the left margin.
- Table borders are aligned outwards from the sides of the cell rectangles.
This produces an overlap with cell borders centered on cell rectangle sides.

This may sound very complicated. See my attached test data and the results,
zoom the test document as much as possible: if this is still an issue!


Hansuli Anderegg



tables.pdf
Description: Adobe PDF document


http://www.w3.org/1999/XSL/Format"; xmlns:src="UBSXMLSrc">










/




table border - cell padding, border








cell 1.1


cell 1.2


cell 1.3




cell 2.1


cell 2.2


cell 2.3




cell 3.1


cell 3.2


cell 3.3






table border, padding top/bottom - cell padding, border








cell 1.1


cell 1.2


cell 1.3




cell 2.1


cell 2.2


cell 2.3




cell 3.1


cell 3.2


cell 3.3






table border, padding left/right - cell border








cell 1.1


cell 1.2


cell 1.3




cell 2.1


cell 2.2


cell 2.3




cell 3.1


cell 3.2


cell 3.3






table border - cell 0








cell 1.1


cell 1.2


cell 1.3




cell 2.1


cell 2.2


cell 2.3




cell 3.1


cell 3.2


cell 3.3






table 0 - cell border








cell 1.1


cell 1.2


cell 1.3




cell 2.1


cell 2.2


cell 2.3




cell 3.1


cell 3.2


cell 3.3






table borders - cell borders dependent from position








cell 1.1


cell 1.2


cell 1.3




cell 2.1


cell 2.2


cell 2.3




cell 3.1


cell 3.2


cell 3.3











-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]


AW: [REDESIGN] Line layout manager discussion

2002-05-06 Thread J.U. Anderegg

By writing renderer code with FOP 0.20.1 I observed :

A basic link

link wordst

arrives 3 times in the PDFrenderer asynchronously, without any connection
between each other.

1. as word "link"
2. as word "words"
3. as annotation rectangle

This is OK with PDF. But there is an assumption on the operation of the
output device. Other document formats: link rendering needs access to all
related data. How about FOP extensions, new versions of xsl:fo? Deep area
tree, linear sequential representation, semantics - I cannot tell. It has to
be device independent.


Fetching info randomly from the area tree?

Some document formats need a list of fonts used at the beginning of the
document or each page. Can the renderer retrieve this info from the the area
tree in advance?  Elimination of intermediate storage makes renderer
programming straight forward.

Hansuli Anderegg



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




AW: Is SVG a preferred way to draw form lines?

2002-05-06 Thread J.U. Anderegg

At least 2 aspects are to be considered: document design/generation and
operation

o SVG
- document design: do you have a tool?
- operation: uses Batik starts new processes and generates images

o xsl:fo table with borders, backgrounds

- document design: type xsl:fo on the hard way?
- operation: FOP only

But will Adobe extend PDF and Acrobat to handle SVG XML?

Hansuli Anderegg





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




AW: [REDESIGN] Line layout manager discussion

2002-05-01 Thread J.U. Anderegg

Questions:

o A basic-link in PDF means an annotation - an annotation defines a
rectangle. What's the effect, if the annotation text breaks to a new line?
If the basic-link contains more blocks and children?

o Middle Easterner write left-to-right, top-to-bottom. Far Easterners write
from top-to-bottom, right-to-left. They have their own font metrics. Is the
FOP pagination able to handle this? How does it affect the area tree and the
document presentation?

o fo:external-graphic: can text be flowed around an image? That means, does
it make sense for a user to mix text and images within the same block -
unless a table is used, but this is a different setup.

Hansuli Anderegg



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




FOP PDF extensions: multilevel outlines, form fields, Javascript

2002-04-25 Thread J.U. Anderegg

Specification Request

I programmed multilevel outlines, form fields, Javascripts with the PDF
classes of Fop-0.20.1. These experiments, attacking from the back end, lead
to these conclusions:


1. PDF Extensions can be added to the PDF classes on a clean way. The trick
is when/where to insert PDF objects to avoid troubles with reference
resolutions.


2. Extension Types

Definition "position": the page and page coordinates of a rendered element.

2.1 Element text/attributes only

example: startup JavaScript



2.2 Element text/attributes + position of parent element

example: outlines

This is a heading level 1
  Go and see heading level 1


2.3 Element text/attributes + position of parent element + reserved
rectangle coordinates

example: form fields


  


(Implemented with external files, which in turn pull in further exteral
JavaScript files in my implementation).

2.4/5/6 corresponding to 2.1/2/3 but a reference to a subtree in xsl:fo
input instead of just text/attributes of a single element.

example: fancier form fields in XML


  

  some Javascript

  
  some PDF stuff
  
  


External Links

2002-04-17 Thread J.U. Anderegg

By looking at PDF I think a link has to be coded like this (copy in the
samples):

link_rectangle

o "destination": an URI, where it makes a difference if there is an
extension .pdf or not
o link_rectangle: the rectangle on the page to click on

So, if you want to have an image in the rectangle:

http://nagoya.apache.org/the_image_to_be_pointed_to.jp
g">
  


The destination has to be a full URI for a file!


Hansuli Anderegg





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




PDF JavaScript and Form Fields: FOP prototype version is available

2002-04-12 Thread J.U. Anderegg

Attached I send a small demo document generated by an adapted FOP system. If
attachements do not work in the forum, send me a request by e-mail.

If there is interest I  will compile the inputs, some comments and a list of
related documents. PDF JavaScript and Form Fields cover a broad range of
applications from simple user navigation/form-fillin to complex
database/transaction systems. Note that many functions need more Adobe
software than just Acrobat Reader.

Hansuli Anderegg, Zurich



link03.pdf
Description: Adobe PDF document

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]


AW: Designing PDF extensions: form fields

2002-04-08 Thread J.U. Anderegg

Forms and JavaScript in PDF may be about as complex as xsl:fo. To get a
feeling for the learning, design and development effort see:

Acrobat JavaScript Object Specification, Version 5.0.5, Technical Note #
5186
Chapter Quick Reference Forms: 20 pages illustrated with Acrobat menues

Keyword "Acrobat GUI": something like that is needed for a comfortable
solution. Have it generate an XML representation and transformed XML back to
PDF syntax by a FOP Extension?

Remains the low level way like PDFMark does it as documented in
http://www.math.uakron.edu/~dpstory/tutorial/pdfmarks/forms.pdf
Very little implementation effort without imposing arbitrary limitations.
Perhaps a user is willing to try this approach and experience will show real
life  requirements.

Hansuli Anderegg, Zurich, Switzerland



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




AW: Designing PDF extensions: form fields

2002-04-04 Thread J.U. Anderegg

Hi Keiron,

Let's fix a DESIGN GOAL. What can be realized in which time frame? I see 2
ways to go ahead:

1. Low level implementation using native PDF syntax: users have to learn PDF
syntax and to some extent PDF file structure. They can try experimentally
everything with the risk of invalid PDF in the document test phase. The
document development might look like this:

- get documentation: PDF reference manual or see PDFmarks in
http://www.math.uakron.edu/~dpstory/tutorial/pdfmarks/forms.pdf
- develop document without form fields
- use Acrobat to add the form fields to the document
- view the PDF document in ASCII e.g. with Windows WordPad and copy form
field PDF objects into FOP markup
- test, modify FOP markup

2. Perfect, complete XML syntax for PDF forms covers all functions. Perhaps
XHTML could do this job. The system is fully documented, so that users never
have to care about PDF internals (my favorite reference document has 96
pages). The PDFextension takes over FOP properties and uses existing PDF
methods. Additional properties needed for PDF form fields are handled.

Of course a clean system (2) is preferable. Where is the expert to take over
this task? Not very elegant system (1) can be set up within 1 month assumed
the pdf library offers an API to allow PDF extensions - the base for other
developments. Once priorities are set, technicalities will be solved
efficiently.


Hansuli Anderegg, Zurich, Switzerland



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Designing PDF extensions: form fields

2002-04-01 Thread J.U. Anderegg

I programmed PDF form fields into Fop-0.20.1. PDF form fields have an
annotation representation in PDF files with the subtype "widget". So I
patched the external-link within the renderer code to process form fields.
Additionally a PDF fields object had to be added to the PDF stream and a
reference to it into the PDF document catalog. So far quite easy.

>From this experience I see now the design below for PDF plugins (rather
"plugin" than "FOP extension", because this is only partially FOP business).
Main areas of concern are the external interface and on the other hand
general methods provided by FOP to generate valid PDF file structures. When
this API is available, features like PDF JavaScript etc. will be easy to
implement. Plugins are not allowed to modify any FOP code.

XSL:FO will be device-dependent. So users will have to take care of that
with XSLT.

Hansuli Anderegg, Zurich, Switzerland

==

EXTERNAL INTERFACE

PDF Form Field Example:

(1) 
(2) 
(3) /T (pb1)
(3) /FT /Btn
(3) /Ff 65536
(3) /H /P /F 4
(3) /BS << /W 2 /S /B >>
(3) /MK << /BC [ 0 0 0 ]
(3) /BG [.7529 .7529 .7529]
(3) /CA (Button) >>



(1) instream-foreign-object asks the FOP formatter for space.


PDF RENDERER

o The foreign-object method of the PDF renderer is called by FOP
- arguments: type, renderer class, renderer method (Strings from 2) and
rectangle coordinates, data.

o control is passed to the specified class/method in "FOPplugin"
- arguments: rectangle coordinates and unprocessed text of XML element
"FOPplugin".

(3) Just anything: in my case the text in native PDF form syntax from the
FOPplugin XML element (transforming PDF form syntax into XML syntax does not
make sense unless Adobe switches to XML). XML in case of SVG. Perhaps a
differenciation between XML and non-XML data will be helpful. Of course the
parser requires valid XML input. Character sets and line endings will have
to be looked at.


INVOKED METHOD by PDF renderer foreign object invokes in turn

o special, separate plugin method(s) (most likely added to PDFDocument
class)
- the plugin has to setup his PDF objects, keep track of his object
references.

FOP has to enable the plugin to insert PDF objects by an API most likely to
be implemented in the PDFDocument class.


GENERAL PDFDocument METHODS provided by FOP

- request a PDF object (including trailer objects) with ID and XREF
maintenance
- add entries/PDF reference ID's to catalog ("outline" requires a catalog
entry too)

Basically this means providing external interfaces to the PDF package. Not
so easy while keeping PDF integrity.

__





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]