Re: problems with printing: fop-0.91

2006-02-20 Thread Jeremias Maerki
I finally had a chance to look at this. Turns out that it works fine if
you print directly, for example, using -print from the command-line.
If you print from the preview dialog, however, the page size is not
correct and therefore content gets swallowed. We'll have to find out why
the Preview window does something different than the rest of the code.

On 17.02.2006 17:35:12 Tim Dyck wrote:
 I went back to version 0.20.5 and was able to get it work fine so that
 is good.  Thanks for the help.
 
 Tim.
 
 -Original Message-
 From: Andreas L Delmelle [mailto:[EMAIL PROTECTED] 
 Sent: Thursday, February 16, 2006 12:35 PM
 To: fop-users@xmlgraphics.apache.org
 Subject: Re: problems with printing: fop-0.91
 
 On Feb 16, 2006, at 18:49, Tim Dyck wrote:
 
 Hi,
 
  Not sure exactly what output renderer I am using at this point, but I
  believe I am using the following renderer (that is what I saw in the
  debugger):
 
application/X-fop-awt-preview
 
  and once the awt preview is opened then I click on the print button
  which calls back into the AWTRenderer (which implements pageable) and
  that is what is failing to print correctly.
 
 Have you also tried different Java versions? Different printer  
 drivers? If either one works, then it would be an unfortunate case of  
 incompatibility between the Java AWT version and the driver...  
 There's little we can do about this from within FOP. We just render  
 to Java2D and pray that the used JRE has no trouble sending it  
 through to the printer correctly :-/ (We had a recent post concerning  
 such an incompatibility: replacing the printer driver made the whole  
 thing work all of a sudden.)
 
 Might be worth a try...
 
  Also, are you saying there is another way to print via FOP with a PDF
  file or are you just saying open up a PDF file in Acrobat Reader and
  print it?
 
 What Manuel is referring to, IIC, is: render to PDF and pipe the  
 resulting PDF through to AcroRead.exe via the command-line. (The same  
 could be done with PostScript as intermediate format. If your  
 printers understand PS, then you could bypass AcroRead.exe entirely  
 and send the output to the printer directly.)


Jeremias Maerki


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



RE: problems with printing: fop-0.91

2006-02-17 Thread Tim Dyck
I went back to version 0.20.5 and was able to get it work fine so that
is good.  Thanks for the help.

Tim.

-Original Message-
From: Andreas L Delmelle [mailto:[EMAIL PROTECTED] 
Sent: Thursday, February 16, 2006 12:35 PM
To: fop-users@xmlgraphics.apache.org
Subject: Re: problems with printing: fop-0.91

On Feb 16, 2006, at 18:49, Tim Dyck wrote:

Hi,

 Not sure exactly what output renderer I am using at this point, but I
 believe I am using the following renderer (that is what I saw in the
 debugger):

   application/X-fop-awt-preview

 and once the awt preview is opened then I click on the print button
 which calls back into the AWTRenderer (which implements pageable) and
 that is what is failing to print correctly.

Have you also tried different Java versions? Different printer  
drivers? If either one works, then it would be an unfortunate case of  
incompatibility between the Java AWT version and the driver...  
There's little we can do about this from within FOP. We just render  
to Java2D and pray that the used JRE has no trouble sending it  
through to the printer correctly :-/ (We had a recent post concerning  
such an incompatibility: replacing the printer driver made the whole  
thing work all of a sudden.)

Might be worth a try...

 Also, are you saying there is another way to print via FOP with a PDF
 file or are you just saying open up a PDF file in Acrobat Reader and
 print it?

What Manuel is referring to, IIC, is: render to PDF and pipe the  
resulting PDF through to AcroRead.exe via the command-line. (The same  
could be done with PostScript as intermediate format. If your  
printers understand PS, then you could bypass AcroRead.exe entirely  
and send the output to the printer directly.)


HTH!

Cheers,

Andreas


-
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]



RE: problems with printing: fop-0.91

2006-02-16 Thread Tim Dyck
Sorry, I am pretty new to this stuff (just started looking at it
yesterday).

Not sure exactly what output renderer I am using at this point, but I
believe I am using the following renderer (that is what I saw in the
debugger):

  application/X-fop-awt-preview

and once the awt preview is opened then I click on the print button
which calls back into the AWTRenderer (which implements pageable) and
that is what is failing to print correctly.  

Also, are you saying there is another way to print via FOP with a PDF
file or are you just saying open up a PDF file in Acrobat Reader and
print it?

Thanks,

Tim.

-Original Message-
From: Manuel Mall [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, February 15, 2006 7:45 PM
To: fop-users@xmlgraphics.apache.org
Subject: Re: problems with printing: fop-0.91

Tim,

you didn't say which renderer (output format) you used for your attempts
at printing. If you used PCL that renderer is non functional in the FOP
0.91 release (that's why it is in the sandbox area). See also
http://xmlgraphics.apache.org/fop/status.html.

Your best option is probably to go via PDF and print the PDF file.
Actually the very best option is if you could find the time to fix the
PCL
renderer :-).

Manuel

 I have tried printing several of the examples given and so far have
been
 unable to get anything to print out correctly.  The specific example
fo
 files that I have tried are:



 ./examples/embedding/xml/fo/helloworld.fo (a blank page gets printed)

 ./examples/embedding/xml/xml/projectteam.xml (the title, and the first
 have of the left column gets cup off)



 ./examples/fo/basic/pdfoutline.fo (last 8 to 9 lines of each page do
not
 get printed though seems)



 I tried a few others and they had similar problems.  I tried both
going
 directly to a printer and also to the program PDFCreator (acts as a
 printer driver) and got exactly the same results.  Though, if I
generate
 a PDF from the fo files and print it from Acrobat then it prints out
 just fine (also tried printing a PDF file generated from a fo using
 PDFBox but had no such luck).  Also, when viewing any of the files
using
 the ExampleAWTViewer they all look fine just when I go to print to
 either a printer or the PDFCreator do I see issues.  I am currently
 using windows XP and am using JDK 1.5.0_05.  Any ideas or suggestions
on
 how I can print and get something to print correctly?  Is anyone else
 seeing these issues?



 Thanks,



 Tim.



 - Code - same code as the ExampleXML2FO.java file just modified it
 to also pop open a print preview of the file to print:



 /*

  * Copyright 1999-2004 The Apache Software Foundation.

  *

  * Licensed under the Apache License, Version 2.0 (the License);

  * you may not use this file except in compliance with the License.

  * You may obtain a copy of the License at

  *

  *  http://www.apache.org/licenses/LICENSE-2.0

  *

  * Unless required by applicable law or agreed to in writing, software

  * distributed under the License is distributed on an AS IS BASIS,

  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
 implied.

  * See the License for the specific language governing permissions and

  * limitations under the License.

  */



 /* $Id: ExampleXML2FO.java 332791 2005-11-12 15:58:07Z jeremias $ */



 package embedding;



 //Java

 import java.io.File;

 import java.io.IOException;

 import java.io.OutputStream;



 //JAXP

 import javax.xml.transform.Transformer;

 import javax.xml.transform.TransformerFactory;

 import javax.xml.transform.TransformerException;

 import javax.xml.transform.Source;

 import javax.xml.transform.Result;

 import javax.xml.transform.stream.StreamResult;

 import javax.xml.transform.stream.StreamSource;



 /**

  * This class demonstrates the conversion of an XML file to an XSL-FO
 file

  * using JAXP (XSLT).

  */

 public class ExampleXML2FO {



 /**

  * Converts an XML file to an XSL-FO file using JAXP (XSLT).

  * @param xml the XML file

  * @param xslt the stylesheet file

  * @param fo the target XSL-FO file

  * @throws IOException In case of an I/O problem

  * @throws TransformerException In case of a XSL transformation
 problem

  */

 public void convertXML2FO(File xml, File xslt, File fo)

 throws IOException, TransformerException {



 //Setup output

 OutputStream out = new java.io.FileOutputStream(fo);

 try {

 //Setup XSLT

 TransformerFactory factory
TransformerFactory.newInstance();

 Transformer transformer = factory.newTransformer(new
 StreamSource(xslt));



 //Setup input for XSLT transformation

 Source src = new StreamSource(xml);



 //Resulting SAX events (the generated FO) must be piped
 through to FOP

 Result res = new StreamResult(out);



 //Start XSLT transformation and FOP processing

Re: problems with printing: fop-0.91

2006-02-16 Thread Andreas L Delmelle

On Feb 16, 2006, at 18:49, Tim Dyck wrote:

Hi,


Not sure exactly what output renderer I am using at this point, but I
believe I am using the following renderer (that is what I saw in the
debugger):

  application/X-fop-awt-preview

and once the awt preview is opened then I click on the print button
which calls back into the AWTRenderer (which implements pageable) and
that is what is failing to print correctly.


Have you also tried different Java versions? Different printer  
drivers? If either one works, then it would be an unfortunate case of  
incompatibility between the Java AWT version and the driver...  
There's little we can do about this from within FOP. We just render  
to Java2D and pray that the used JRE has no trouble sending it  
through to the printer correctly :-/ (We had a recent post concerning  
such an incompatibility: replacing the printer driver made the whole  
thing work all of a sudden.)


Might be worth a try...


Also, are you saying there is another way to print via FOP with a PDF
file or are you just saying open up a PDF file in Acrobat Reader and
print it?


What Manuel is referring to, IIC, is: render to PDF and pipe the  
resulting PDF through to AcroRead.exe via the command-line. (The same  
could be done with PostScript as intermediate format. If your  
printers understand PS, then you could bypass AcroRead.exe entirely  
and send the output to the printer directly.)



HTH!

Cheers,

Andreas


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



Re: problems with printing: fop-0.91

2006-02-15 Thread Manuel Mall
Tim,

you didn't say which renderer (output format) you used for your attempts
at printing. If you used PCL that renderer is non functional in the FOP
0.91 release (that's why it is in the sandbox area). See also
http://xmlgraphics.apache.org/fop/status.html.

Your best option is probably to go via PDF and print the PDF file.
Actually the very best option is if you could find the time to fix the PCL
renderer :-).

Manuel

 I have tried printing several of the examples given and so far have been
 unable to get anything to print out correctly.  The specific example fo
 files that I have tried are:



 ./examples/embedding/xml/fo/helloworld.fo (a blank page gets printed)

 ./examples/embedding/xml/xml/projectteam.xml (the title, and the first
 have of the left column gets cup off)



 ./examples/fo/basic/pdfoutline.fo (last 8 to 9 lines of each page do not
 get printed though seems)



 I tried a few others and they had similar problems.  I tried both going
 directly to a printer and also to the program PDFCreator (acts as a
 printer driver) and got exactly the same results.  Though, if I generate
 a PDF from the fo files and print it from Acrobat then it prints out
 just fine (also tried printing a PDF file generated from a fo using
 PDFBox but had no such luck).  Also, when viewing any of the files using
 the ExampleAWTViewer they all look fine just when I go to print to
 either a printer or the PDFCreator do I see issues.  I am currently
 using windows XP and am using JDK 1.5.0_05.  Any ideas or suggestions on
 how I can print and get something to print correctly?  Is anyone else
 seeing these issues?



 Thanks,



 Tim.



 - Code - same code as the ExampleXML2FO.java file just modified it
 to also pop open a print preview of the file to print:



 /*

  * Copyright 1999-2004 The Apache Software Foundation.

  *

  * Licensed under the Apache License, Version 2.0 (the License);

  * you may not use this file except in compliance with the License.

  * You may obtain a copy of the License at

  *

  *  http://www.apache.org/licenses/LICENSE-2.0

  *

  * Unless required by applicable law or agreed to in writing, software

  * distributed under the License is distributed on an AS IS BASIS,

  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
 implied.

  * See the License for the specific language governing permissions and

  * limitations under the License.

  */



 /* $Id: ExampleXML2FO.java 332791 2005-11-12 15:58:07Z jeremias $ */



 package embedding;



 //Java

 import java.io.File;

 import java.io.IOException;

 import java.io.OutputStream;



 //JAXP

 import javax.xml.transform.Transformer;

 import javax.xml.transform.TransformerFactory;

 import javax.xml.transform.TransformerException;

 import javax.xml.transform.Source;

 import javax.xml.transform.Result;

 import javax.xml.transform.stream.StreamResult;

 import javax.xml.transform.stream.StreamSource;



 /**

  * This class demonstrates the conversion of an XML file to an XSL-FO
 file

  * using JAXP (XSLT).

  */

 public class ExampleXML2FO {



 /**

  * Converts an XML file to an XSL-FO file using JAXP (XSLT).

  * @param xml the XML file

  * @param xslt the stylesheet file

  * @param fo the target XSL-FO file

  * @throws IOException In case of an I/O problem

  * @throws TransformerException In case of a XSL transformation
 problem

  */

 public void convertXML2FO(File xml, File xslt, File fo)

 throws IOException, TransformerException {



 //Setup output

 OutputStream out = new java.io.FileOutputStream(fo);

 try {

 //Setup XSLT

 TransformerFactory factory TransformerFactory.newInstance();

 Transformer transformer = factory.newTransformer(new
 StreamSource(xslt));



 //Setup input for XSLT transformation

 Source src = new StreamSource(xml);



 //Resulting SAX events (the generated FO) must be piped
 through to FOP

 Result res = new StreamResult(out);



 //Start XSLT transformation and FOP processing

 transformer.transform(src, res);

 } finally {

 out.close();

 }

 }





 /**

  * Main method.

  * @param args command-line arguments

  */

 public static void main(String[] args) {

 try {

 System.out.println(FOP ExampleXML2FO\n);

 System.out.println(Preparing...);



 //Setup directories

 File baseDir = new File(.);

 File outDir = new File(baseDir, out);

 outDir.mkdirs();



 //Setup input and output files

 File xmlfile = new File(baseDir, xml/xml/projectteam.xml);

 File xsltfile = new File(baseDir,
 xml/xslt/projectteam2fo.xsl);

 File fofile = new File(outDir, ResultXML2FO.fo);



 File newFoFile = new