RE: Attaching PDF to FOP output

2004-08-02 Thread Sells, Fred
I used iText recently; pretty simple.

package org.ahss.acc.pdftools;

import java.io.*;

import com.lowagie.text.*;
import java.awt.Color;
import com.lowagie.text.pdf.*;
import java.util.*;

public class PdfFileManipulator {

public PdfFileManipulator() {}

public static void cat(ArrayList inFiles, String outFile)
throws IOException, FileNotFoundException,
   DocumentException, BadPdfFormatException{
int pageOffset = 0;
ArrayList master = new ArrayList();
System.out.println(writeing to +outFile);
Document document = null;
PdfCopy  writer = null;
for (Iterator I = inFiles.iterator(); I.hasNext(); ) {
AdmissionDocument admdoc = (AdmissionDocument)I.next();
PdfReader reader = new PdfReader(admdoc.File);//create reader for
document
reader.consolidateNamedDestinations();
int n = reader.getNumberOfPages();//retrieve total number of pages
java.util.List bookmarks = SimpleBookmark.getBookmark(reader);
master.add(createBookMark(admdoc.Title, pageOffset+1));
if (bookmarks != null) {
if (pageOffset != 0) SimpleBookmark.shiftPageNumbers(bookmarks,
pageOffset, null);
master.addAll(bookmarks);
}
pageOffset += n;
System.out.println(There are  + n +  pages in  + admdoc.File);
if (document==null) {
document = new Document(reader.getPageSizeWithRotation(1));
writer = new PdfCopy(document, new FileOutputStream(outFile));
document.open();
}
for (int i = 1; i = n; i++ ) {// step 4: we add content
PdfImportedPage page = writer.getImportedPage(reader, i);
writer.addPage(page);
}
}
if (master.size()  0) writer.setOutlines(master);//bookmarks
document.close();// step 5: we close the document
writer.close();
}

private static HashMap createBookMark(String title, int page) {
HashMap bookmark = new HashMap();
bookmark.put(Action, GoTo);
bookmark.put(Title, title);
bookmark.put(Page, +page+ XYZ 0 1000 null);
return bookmark;
}


}//= end of class


-Original Message-
From: Glen Mazza [mailto:[EMAIL PROTECTED]
Sent: Monday, August 02, 2004 7:36 AM
To: [EMAIL PROTECTED]
Subject: Re: Attaching PDF to FOP output
Importance: Low


Apparently a product called PJ and also iText are
able to post-process a FOP-made (or any other) PDF
document.  I suspect they will be able to append
another PDF, but haven't used these products yet so I
don't know for sure.  See here:

http://marc.theaimsgroup.com/?l=fop-userm=108131949107145w=2

Glen

--- S?nke_Ruempler [EMAIL PROTECTED] wrote:

 Hi,
 
 Maybe a little bit offtopic:
 
 Is it possible to attach a PDF file to a FOP output?
 
 --
 
 S?nke
 
 

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


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

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



Merging multiple PDF's into 1 file

2004-07-12 Thread Sells, Fred
I'm using a Tomcat servelt to generate multiple PDF's at one time.  This
represents a report with a bunch of attachments.  The header and footer
information varies and I may need to vary page layout.  I would prefer to
generate each PDF separately (using XML and XSLT with FOP) rather that one
big PDF.

But I need to merge the separate PDF's into a single file; preferably with
bookmarks for each file.

I would like to do this within the Java Servlet environment and not go to a
cgi script if practical.

Can anyone recommend some free (or cheap :) tools that would help to do
this. I've googled this and followed several links for tools that promise
to do this.  I'm hoping to take advantage of others experiences to avoid
banging through each one to see which ones deliver.

thanks, fred.

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



RE: background lines

2003-11-07 Thread Sells, Fred
I would like to draw the background lines in a static region in the hope
that it exists only once in the PDF file to reduce file size.  Some of our
remote users are still using dial-in and size does matter :)

the info which is resident in the database is super-imposed over the
background lines to allow users to hand-write additional information as
required.  An example is attached.

-Original Message-
From: J.Pietschmann [mailto:[EMAIL PROTECTED]
Sent: Monday, November 03, 2003 3:12 PM
To: [EMAIL PROTECTED]
Subject: Re: background lines
Importance: Low


Sells, Fred wrote:
 I need to print a form where there are lines to aid in hand-writing
 additions to the printed information.  I have used background-image= to
put
 lines where I don't print content and this works.
 
 However the file size is doubled by the background image and it seems that
 it does not repeat a single image, but copies it multiple times.  I
would
 like to use a table to draw the lines in my region-before; however that
 always shows up on top of region body.

Why do you think you have to use a table in the *before* region,
instead of the flow, for drawing the auxillary lines? Why do you
use overlapping regions? I'm confused.
A somewhat more complete description, including some context where
the auxillary lines have to appear, would be helpful.

J.Pietschmann


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



bglines.pdf
Description: Binary data
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

RE: background lines

2003-11-04 Thread Sells, Fred
attached is a sample output; the magenta lines are created by a
background-image.  The xsl that I use to do this is also attached as
careplan.before 

-Original Message-
From: J.Pietschmann [mailto:[EMAIL PROTECTED]
Sent: Monday, November 03, 2003 3:12 PM
To: [EMAIL PROTECTED]
Subject: Re: background lines
Importance: Low


Sells, Fred wrote:
 I need to print a form where there are lines to aid in hand-writing
 additions to the printed information.  I have used background-image= to
put
 lines where I don't print content and this works.
 
 However the file size is doubled by the background image and it seems that
 it does not repeat a single image, but copies it multiple times.  I
would
 like to use a table to draw the lines in my region-before; however that
 always shows up on top of region body.

Why do you think you have to use a table in the *before* region,
instead of the flow, for drawing the auxillary lines? Why do you
use overlapping regions? I'm confused.
A somewhat more complete description, including some context where
the auxillary lines have to appear, would be helpful.

J.Pietschmann


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



backgroundlines.pdf
Description: Binary data


careplan.before
Description: Binary data
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

background lines

2003-11-03 Thread Sells, Fred
I need to print a form where there are lines to aid in hand-writing
additions to the printed information.  I have used background-image= to put
lines where I don't print content and this works.

However the file size is doubled by the background image and it seems that
it does not repeat a single image, but copies it multiple times.  I would
like to use a table to draw the lines in my region-before; however that
always shows up on top of region body.

I'm using fop 0.20.5.

Does anyone know a work-around?

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



drawing background lines

2003-10-13 Thread Sells, Fred
I need to put horizontal lines on my PDF so the user can write more stuff on
the printout.

I tried using a background image.  It looked good but doubled the size of my
PDF.  Seemed like fop was generating multiple copies of image. Our users
have low-end computers and printers and a 30 page document is taking 30
minutes to print.  I think this may also be a W95 :( sysconfig issues, but
that's not an area I'm knowledgable in.

I removed the image and tried drawing horizontal lines in the region-before.
This worked, but the lines show through blocks in the body, even if I set
the background-color of the block in the body.

has anyone overcome this problem?

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



RE: table row color changing [spam-BCC][Faked From Address][html- removed]

2003-09-19 Thread Sells, Fred
according to the O'reilly book, the only way to increment a variable is to
call a template recursively.  I think I've seen an example of what you want
where they used a count and the mod function to alternate row color, but
don't recall the code.

-Original Message-
From: Ramon Maria Gallart [mailto:[EMAIL PROTECTED]
Sent: Friday, September 19, 2003 6:03 AM
To: [EMAIL PROTECTED]
Subject: table row color changing [spam-BCC][Faked From
Address][html-removed]
Importance: Low


Hi all.
 
Can anyone tell me the way to change the colors of a table rows? I mean,
the first in a color the next with other color, the next one with the
first color and so on... I've tried to do it using an external variable
but when i change it inside the loop it seems not to recognize it.
 
Thanks a lot.
 
Ramon Maria.

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



RE: XSL-FO - page borders [spam-BCC][Faked From Address][html-rem oved]

2003-09-18 Thread Sells, Fred
not sure, but you don't specify color, try adding that.

-Original Message-
From: Ganesh [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 18, 2003 11:11 AM
To: [EMAIL PROTECTED]
Subject: XSL-FO - page borders [spam-BCC][Faked From
Address][html-removed]



Hi,
 
It will be great if you guys can help me with the following in XSL-FO...
 
I want a LEFT page border that runs from the top of the page till the
end of the page, how can I do this using XSL-FO? I assume that is has to
be done in the simple-page-master...
 
I tried the following in the simple page master, it didn't work, any
clue?, am I going in the right direction?
fo:region-body border-left-style=solid border-left-width=2mm
margin-top=3cm margin-bottom=1cm/
 
With the above statement I got NO border at all.
 
Thanks for any inputs.
 
Regards,
Ganesh
 
 

**Disclaimer

Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' and 'confidential' and intended for use only by the individual
 or entity to which it is addressed. You are notified that any use, copying 
or dissemination of the information contained in the E-MAIL in any manner 
whatsoever is strictly prohibited.

***

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



RE: container position=absolute seems to be off [spam-BCC][Faked From Address][html-removed]

2003-09-16 Thread Sells, Fred
I never got it to work at all; good to know the commercial one also failed,
I was going to try that next.

let me know if you solve this
[EMAIL PROTECTED]

-Original Message-
From: Randy Paries [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 16, 2003 4:13 PM
To: [EMAIL PROTECTED]
Subject: container position=absolute seems to be off [spam-BCC][Faked
From Address][html-removed]


Hello,
 
i am working on an application that creates an .fo that represents a
page of labels
 
The problem is that is appears that the container position=absolute
settings are correct, but each block container is off a little(i have
included example code below)
 
the first label should start 1/2 inches from the top and then each
label(block-container) should be an inch long.
 
it seems that the first box start 1/8 to long and the 1'
block-containers are actually 7/8's of an inch. So by the time we get
half way down the sheet the labels are all off.
 
I also tried a commercial FOP and it produces the same results.
thanks for any help , hints or suggestions
=debug.fo===

?xml version=1.0 encoding=UTF-8?
fo:root xmlns:svg=http://www.w3.org/2000/svg;
xmlns:fo=http://www.w3.org/1999/XSL/Format;
fo:layout-master-set
fo:simple-page-master master-name=column-page page-height=11.0in
page-width=8.5in
fo:region-body margin-top=0in margin-bottom=0in margin-left=0in
margin-right=0in/
/fo:simple-page-master
/fo:layout-master-set
fo:page-sequence initial-page-number=1
master-reference=column-page
   fo:flow flow-name=xsl-region-body
fo:block-container position=absolute top=0.5in left=0.19in
height=1.00in width=2.63in
fo:block background-color=white border=.25pt solid black
text-align=center
fo:block line-height=14pt text-align=left
fo:wrapper color=black font-size=12pt font-style=normal
font-weight=normal font-family=Times Roman
white-space-collapse=trueBatson Medical Institute/fo:wrapper
/fo:block
fo:block line-height=14pt text-align=left
fo:wrapper color=black font-size=12pt font-style=normal
font-weight=normal font-family=Times Roman
white-space-collapse=trueJHawkins/fo:wrapper
/fo:block
fo:block line-height=14pt text-align=left
fo:wrapper color=black font-size=12pt font-style=normal
font-weight=normal font-family=Times Roman
white-space-collapse=trueJonathan Hawkins/fo:wrapper
/fo:block
fo:block line-height=14pt text-align=left
fo:wrapper color=black font-size=12pt font-style=normal
font-weight=normal font-family=Times Roman
white-space-collapse=true4548 Peachtree Street/fo:wrapper
/fo:block
/fo:block
/fo:block-container
fo:block-container position=absolute top=1.5in left=0.19in
height=1.00in width=2.63in
fo:block background-color=white border=.25pt solid black
text-align=center
fo:block line-height=14pt text-align=left
fo:wrapper color=black font-size=12pt font-style=normal
font-weight=normal font-family=Times Roman
white-space-collapse=trueNetwork Medical Associates/fo:wrapper
/fo:block
fo:block line-height=14pt text-align=left
fo:wrapper color=black font-size=12pt font-style=normal
font-weight=normal font-family=Times Roman
white-space-collapse=trueVJackson/fo:wrapper
/fo:block
fo:block line-height=14pt text-align=left
fo:wrapper color=black font-size=12pt font-style=normal
font-weight=normal font-family=Times Roman
white-space-collapse=trueVirginia Jackson/fo:wrapper
/fo:block
fo:block line-height=14pt text-align=left
fo:wrapper color=black font-size=12pt font-style=normal
font-weight=normal font-family=Times Roman
white-space-collapse=true478 Alabama Avenue/fo:wrapper
/fo:block
/fo:block
/fo:block-container
fo:block-container position=absolute top=2.5in left=0.19in
height=1.00in width=2.63in
fo:block background-color=white border=.25pt solid black
text-align=center
fo:block line-height=14pt text-align=left
fo:wrapper color=black font-size=12pt font-style=normal
font-weight=normal font-family=Times Roman
white-space-collapse=trueNetwork Medical Associates2 /fo:wrapper
/fo:block
fo:block line-height=14pt text-align=left
fo:wrapper color=black font-size=12pt font-style=normal
font-weight=normal font-family=Times Roman
white-space-collapse=truedasdasd/fo:wrapper
/fo:block
fo:block line-height=14pt text-align=left
fo:wrapper color=black font-size=12pt font-style=normal
font-weight=normal font-family=Times Roman
white-space-collapse=trueVirginia Wolf/fo:wrapper
/fo:block
fo:block line-height=14pt text-align=left
fo:wrapper color=black font-size=12pt font-style=normal
font-weight=normal font-family=Times Roman
white-space-collapse=true478 Alabama Avenue/fo:wrapper
/fo:block
/fo:block
/fo:block-container
fo:block id=lastPage/
/fo:flow
/fo:page-sequence
/fo:root

=end
===
 

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



RE: Database data - PDF [spam-BCC][Faked From Address][html-remov ed]

2003-09-04 Thread Sells, Fred
I'm hardly an expert on this, but what I do is.
1. create a jdom tree representing my data
2. write the jdom tree to XML using it's built-in output generators
3. hand write an xsl file
4. pass the xsl and xml to fop

I realize that I can skip step 2 and do this part internally, but I had
trouble getting all the IO objects to match up and was under the gun.  Also
the files make it easy to test and tweak your xsl until you've got it right.

-Original Message-
From: catal [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 04, 2003 10:11 AM
To: [EMAIL PROTECTED]
Subject: Database data - PDF [spam-BCC][Faked From
Address][html-removed]


HI

I used FOP for about 6 months for generating dinamic PDFs. Mainly the
reports I generate are in table-like form and currently I use the following
pattern:
I get data from PostgreSql database. I've have made a library from classes
that wraps fo elements. For example I build a table cell using:

 FoTableCellAttributes rowCellAtrs = new
FoTableCellAttributes(FoColors.WHITE, new FoSize(1,FoUnits.PT).toString(),
new FoSize(0.5,FoUnits.PT).toString(), FoBorder.BORDER_STYLE_SOLID, null);
 FoBlockAttributes rowBlockAtrs = new FoBlockAttributes(FoFonts.TIMES,new
FoSize(10,FoUnits.PT),FoColors.RED,FoAlign.TEXT_ALIGN_JUSTIFY,null,null,null
,null,FoAlign.VERTICAL_ALIGN_MIDDLE);
new FoTableCell(text i want in this cell,rowBlockAtrs,rowCellAtrs)

of course I have classes for table and flows and allmost everything I need
to put in an PDF file. 
All this classes overrides toString method so every class will print the
corresponding Fo code. For example FoBlock class will have it's toString
result something like:fo:block font_size. 
Now all this classes are using the hierachy that fo elements have, so all
this classes are added to their parents and finnaly to a class that
represents the fo container.
After i build this container I use a DataOutputStream to put the toString
representation of all this classes in a Fo file. This file I pass to FOP to
convert to PDF.
The main problem is that this mechanism takes quite a long time to get done.


Now the question: Is that a better way to do this? I realy have the feeling
that there is way to do this more easily and more optimal.

--
--

---
Dumitru Marius Catalin   S.C. Vision Systems S.R.L.
( IT Consultant ) Mihail Kogalniceanu 21
  Business Palace - Centrul
Civic
   Brasov,
Romania

voice: +40-723-508411 Tel./fax. +40-268-419755
http://www.vision-systems.ro   Homepage

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



absolute position

2003-09-04 Thread Sells, Fred
I have not been able to get position-absolute to work for block-container,
using the latest release of fop.

I've tried every permutation and combination I could think of.

Should it work?

If so, could someone provide a working snippet?

tia

Fred Sells

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



absolute-position bug?

2003-08-23 Thread Sells, Fred
I need to use absolute-position to put an address in the right spot for a
window envelope.  I tried the following using fop 0.20.5. I cannot seem to
get it to move from the top-left corner of the flow.  What am I missing?

fo:flow flow-name=xsl-region-body font-size=12pt 

xsl:for-each select=letters
xsl:for-each select=letter

fo:block-container absolute-position=absolute top=3.0in height=2.0in

 left=1.0in width=3.0in background-color=red
fo:block  z  aa aa
aa
a    ddd
d
a    ddd
d
a    ddd
d
a    ddd
d
a    ddd
d
/fo:block
/fo:block-container

...

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



RE: text align on the left in a table-cell [adr][Faked From Addre ss][html-removed]

2003-06-13 Thread Sells, Fred
you have a space after the word left 

-Original Message-
From: Francisco GarcĂ­a Leal [mailto:[EMAIL PROTECTED]
Sent: Friday, June 13, 2003 8:04 AM
To: [EMAIL PROTECTED]
Subject: text align on the left in a table-cell [adr][Faked From
Address][html-removed]


Hello.
 
  I have a table and I would like to align the text on the left, and
then I use the text-aling property with left value:
 
fo:table
 fo:table-column column-width=2.5cm/
 fo:table-column column-width=5.2cm/
  fo:table-header
fo:table-row
  fo:table-cell  border=0.5pt solid
padding=2pt
 fo:block text-align=left 
space-after=5pt Registro/fo:block
   /fo:table-cell
 ...
 
   but I get the text in the center with spaces on the left.
 
 
   I have another problem, if I have long text in the body:
fo:table-cell  border=0.5pt solid padding=2pt
fo:block font-weight=normal text-align=left 
wrap-option=no-wrapxsl:value-of select=Registro/
  /fo:block
   
 
  I get the text out of the cell.
 
 
  Thanks in advance.
 
  Francisco.

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



RE: IDE for Fo creation [adr][Faked From Address][mx][html-remove d]

2003-06-03 Thread Sells, Fred
XMLspy enterprise edition (i.e. StyleVision) does it but poorly.  not all
features supported; no docs and code generated is way too verbose and ugly.
I used to to get a first pass, but when I needed more I had to rewrite the
entire xsl file. 

-Original Message-
From: Kodandapani A. [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 03, 2003 12:06 AM
To: [EMAIL PROTECTED]
Subject: IDE for Fo creation [adr][Faked From Address][mx][html-removed]
Importance: Low


Hi,
 
Is there any IDE available for creating FO objects. 
 
thanks in advace
- KP
 


DISCLAIMER:
This message (including attachment if any) is confidential and may be
privileged. Before opening attachments please check them for viruses and
defects. MindTree Consulting Private Limited (MindTree) will not be
responsible for any viruses or defects or any forwarded attachments
emanating either from within MindTree or outside. If you have received this
message by mistake please notify the sender by return  e-mail and delete
this message from your system. Any unauthorized use or dissemination of this
message in whole or in part is strictly prohibited.  Please note that
e-mails are susceptible to change and MindTree shall not be liable for any
improper, untimely or incomplete transmission.

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



background-image bug

2003-06-02 Thread Sells, Fred
background-image option works when rendering a pdf file but does not show up
when outputting to screen using the -awt option.

no big deal; except I spent alot of time trying to figure out what I was
doing wrong.

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



background-image newbie

2003-05-30 Thread Sells, Fred
I'm trying to use background-image to produce a lined body so that the use
can write additional notes on the printed form.  I have tried both gif and
jpg without success.  I've read XSL formatting objects by Lovel and revied
the fop faq's.  I'm still stumped and obviously missing something quite
simple.  Here's what I've tried.
---
 
xsl:include href=background.xsl/
...
fo:flow flow-name=xsl-region-body xsl:use-attribute-sets=background
 
where background.xsl is:
?xml version=1.0 encoding=UTF-8?
xsl:stylesheet version=1.0
xmlns:xsl=http://www.w3.org/1999/XSL/Transform;
  xmlns:fo=http://www.w3.org/1999/XSL/Format;
xsl:attribute-set name=body
xsl:attribute
name=background-imagelinebackground.gif/xsl:attribute
/xsl:attribute-set
/xsl:stylesheet

-or --
fo:flow flow-name=xsl-region-body background-image=linebackground.jpg
 
 
I realize I don't have a clue and would be gratefull to a pointer in the
right direction.
 
tia.
 
Fred.

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