Embedded EPS in PDF

2004-01-20 Thread Torsten
Hello fop-users,

I have a problem if I insert a eps file in a pdf document (as
external-graphic).
This graphic will be inserted and Acrobat Reader naturally ignores the
postscript content inside the pdf, also a postcript printer prints
this document correctly, because its interpreter ignores the binary
preview data.

If I try to redistill this pdf file using ghostscript (to make the
postscript content visible), gs complaints about this preview content and stops
the rendering.

A first look at the EPSReader class #verifySignature shows me that
there is a correct check for binary header (0xC5D0D3C6), but the
incoming streambuffer always starts with 0x37338083 (%!PS). That would be
wonderful for, but it seems to be, that in the pdf, the original data (inclusive
preview) is inserted ;(

Has anyone an idea where I have to look, to eleminate this (bug)?
  

-- 
Best regards,
 Torsten  mailto:[EMAIL PROTECTED]


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



Including images from a servlet

2004-01-20 Thread Richard Sweeney
Hi,

I'm using FOP with a servlet. The servlet generates XML which is then
translated using XSL or, if the user clicks print, will take the XML and
generate a PDF. In the XSL-FO I have an image that appears in the produced
PDF and reference it like so:

fo:external-graphic src=url(logo.jpg)/

if I do it this way though then the image is searched for in the current
directory, usually the Web Server's bin directory, so I usually have to
write it like so:

fo:external-graphic src=url(path/to/file/logo.jpg)/

is there a way to make it search for the image in the current directory,
i.e. the same one as the XSL-FO stylesheet?

Thanks

Richard

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



Re: Including images from a servlet

2004-01-20 Thread Chris Bowditch
Richard Sweeney wrote:
snip/
fo:external-graphic src=url(path/to/file/logo.jpg)/
is there a way to make it search for the image in the current directory,
i.e. the same one as the XSL-FO stylesheet?
You can set the base directory for which relative paths will be resolved 
against. This can be done using a configuration file, or set in a 
program. See:

http://xml.apache.org/fop/faq.html#servlet-baseDir
Chris

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


Embeded EPS in PDF

2004-01-20 Thread Torsten
Hello fop-user,

  Forget the previous mail ;)
  I've redirected a stream into a file and see the prob now.
  We don't send the eps-file to fop, but we create an 'real'
  postscript file which has the eps included (plus some extra listing
  informations).

  Now EPSReader only checks the first 4 byte for an binary preview
  header, but this header can be located at any place in the 'ps'
  file (one header for each included eps with preview).

  I don't know, whether this is conform to the postscript specification.
  If yes, it is necessary to scan the whole file for possibly
  embedded eps file(s) and to skip ALL! preview data and binary
  headers of all included eps files.

  Does anyone know, whether this is a bug (I can fix it and send a
  patch), or not rule conform from our side, then I remove the preview
  before inserting it in the postscript.
  
  ThanX Tox


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



RE: Including images from a servlet

2004-01-20 Thread mathieu . fretiere
URL : unknown protocol: c

Well, 'c' is not a protocol, you should try something like :
file:C:///stylesheets/fop
or 
url('file:C:///stylesheets/fop')

I'm no sure, experts will tell you more

Mathieu

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



Re: Including images from a servlet

2004-01-20 Thread J.Pietschmann
Richard Sweeney wrote:
[ERROR] Error while creating area : Invalid Image URL - error on relative
URL : unknown protocol: c  ---(that's actually where the message ends)
Check the FAQ:
 http://xml.apache.org/fop/faq.html#MalformedURLException
J.Pietschmann
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Error on AIX box with no X-Windows

2004-01-20 Thread J.Pietschmann
Manjush G. Menon wrote:
The java code exits; without throwing an Exception at the line
where new Driver() instance is created.
Does this have any relation with X-Windows?
That's hard to say without taking a look at the actual
exception message. However, FOP has indeed problems on
headless servers, check the FAQ:
 http://xml.apache.org/fop/faq.html#svg-headless
J.Pietschmann
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Embeded EPS in PDF

2004-01-20 Thread Jeremias Maerki
Hi Torsten

On 20.01.2004 15:43:00 Torsten wrote:
 Hello fop-user,
 
   Forget the previous mail ;)
   I've redirected a stream into a file and see the prob now.
   We don't send the eps-file to fop, but we create an 'real'
   postscript file which has the eps included (plus some extra listing
   informations).
 
   Now EPSReader only checks the first 4 byte for an binary preview
   header, but this header can be located at any place in the 'ps'
   file (one header for each included eps with preview).
 
   I don't know, whether this is conform to the postscript specification.

You can check yourself:
http://partners.adobe.com/asn/tech/ps/technotes.jsp

Look for:
 Encapsulated PostScript (EPS) File Format Specification Version 3.0
 #5002   5/1/92 (PDF: 182 KB / 34 pages)

My interpretation of the EPS specs is indeed so that all parts (EPS or
preview) can be located at any place. That's what the indices and
section sizes are for. But this applies to device-specific screen
previews only. There are also device-independent screen previews that
work with DSC comments which are, however, not supported by the
EPSReader ATM.

   If yes, it is necessary to scan the whole file for possibly
   embedded eps file(s) and to skip ALL! preview data and binary
   headers of all included eps files.

Are you talking about multi-page EPS files perhaps? I don't think there
may be multiple binary headers as described in chapter 5 of the EPS 3.0
specs. Maybe you could post (or provide a link to) one of your EPS files so
I can see what kind of EPS file you're talking about. I understand there
are quite a few flavours.

   Does anyone know, whether this is a bug (I can fix it and send a
   patch), or not rule conform from our side, then I remove the preview
   before inserting it in the postscript.

As indicated above I can't tell right now if it's a bug. We are
certainly eager to get any patches with improvements for FOP. Simply
keep in mind that if you patch FOP 0.20.5 or the maintenance branch from
CVS your patch will most likely not make it into the codebase as the
development focus is clearly on HEAD. Patches for HEAD are highly
welcome however. But I guess you know that already. We keep talking
about that all the time and it gets boring. :-)


Jeremias Maerki


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



NullPointer in setupDefaultMappings in embedded FOP

2004-01-20 Thread Angus McIntyre
I'm writing a Java application which uses embedded FOP to convert XML 
to PDF. My code is based on ExampleXML2PDF (which does the XSLT 
transformation internally), and I'm running FOP 0.20.5 under Java 
1.4.1 on a MacOS X machine.

I get the following error:
Exception in thread main java.lang.NullPointerException
at org.apache.fop.apps.Service.providers(Driver.java:597)
at org.apache.fop.apps.Driver.setupDefaultMappings(Driver.java:319)
at org.apache.fop.apps.Driver.init(Driver.java:222)
at the point at which my code calls 'driver.setOutputStream'. Here 
are some data points:

1. The XSLT stylesheet is good; using the FOP Ant task to apply
   it to the input XML document produces the correct PDF output.
2. The transformation is working correctly within the application;
   redirecting the output from the transform to a StreamResult
   (rather than the SAXResult used to drive FOP) produces a '.fo'
   document which is identical to the one produced by the Ant
   Style task, and which can then be fed to Ant FOP without
   problems.
3. The application is able to read the required input files and
   write the required output files: no permissions or missing
   directory problems.
Any suggestions as to the possible cause of this problem, and fixes 
or workarounds would be very welcome. The relevant piece of my code 
is shown below.

Thanks in advance,
Angus

  Driver driver = new Driver();
  driver.setRenderer(Driver.RENDER_PDF);
  File outpath = new File(targetdirectory,getOutputFilename(file));
  File tmppath = new File(targetdirectory,getTemporaryFilename(file));
  try {
driver.setOutputStream(new java.io.FileOutputStream(tmppath));
Transformer transformer = compiledstylesheet.newTransformer();
transformer.transform(new StreamSource(file),
  new SAXResult(driver.getContentHandler()));
}
catch (Exception e) { }

--
Business: http://www.nomadcode.com/Personal: http://www.raingod.com/angus/
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]