Re: Error including a PDF inside another PDF

2011-06-17 Thread mehdi houshmand
Hi Jose,

The ERROR message is the key here, it's indicative of an absence of an
image loader for PDFs. You need to have the FOP-pdf-images JAR to your
class path, you can get the JAR from this link
http://www.jeremias-maerki.ch/download/fop/pdf-images/ and to put it
in your class path, the easiest way would be to drop the jar in your
lib/ folder.

Hope that helps

Mehdi

On 17 June 2011 04:16, JOSE L MARTINEZ-AVIAL jlm...@gmail.com wrote:
 Hi,
   I'm using FOP 0.95 to add an address cover to a PDF I receive. I'm doign
 this:

 fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format;
    xsl:call-template name=letter-layout-portrait/
    xsl:call-template name=address/
    fox:external-document content-type=pdf src=prueba.pdf/
 /fo:root

 The document is composed, but the external file is not added, and I see the
 following lines in the log

 2011-06-16 23:11:16,099 DEBUG
 org.apache.xmlgraphics.image.loader.impl.AbstractImageSessionContext  -
 Creating new Source for prueba.pdf
 2011-06-16 23:11:16,115 DEBUG
 org.apache.fop.image.loader.batik.PreloaderSVG  - Error while trying to load
 stream as an SVG file: Content is not allowed in prolog.
 2011-06-16 23:11:16,115 DEBUG
 org.apache.fop.image.loader.batik.PreloaderSVG  - Error while trying to load
 stream as an SVG file: Content is not allowed in prolog.
 2011-06-16 23:11:16,193 ERROR org.apache.fop.apps.FOUserAgent  - Image not
 available. URI: prueba.pdf. Reason:
 org.apache.xmlgraphics.image.loader.ImageException: The file format is not
 supported. No ImagePreloader found for prueba.pdf (No context info
 available)

 The contentype is set to pdf, so I don't why FOP is trying to read it as a
 SVG. Any ideas?

 Thanks

 Jose



-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org



RE: Error including a PDF inside another PDF

2011-06-17 Thread Theresa Jayne Forster
On a slightly different note can you use the FOP-pdf-images.jar to extract
thumbnails of PDFs?

Kindest regards


Theresa Forster
Senior Software Developer

-Original Message-
From: mehdi houshmand [mailto:med1...@gmail.com] 
Sent: 17 June 2011 08:00
To: fop-users@xmlgraphics.apache.org
Subject: Re: Error including a PDF inside another PDF

Hi Jose,

The ERROR message is the key here, it's indicative of an absence of an
image loader for PDFs. You need to have the FOP-pdf-images JAR to your
class path, you can get the JAR from this link
http://www.jeremias-maerki.ch/download/fop/pdf-images/ and to put it
in your class path, the easiest way would be to drop the jar in your
lib/ folder.

Hope that helps

Mehdi



-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org



Re: Error including a PDF inside another PDF

2011-06-17 Thread mehdi houshmand
Hi Theresa,

To put it simply, no. As far as I'm aware and I've done some testing
of this, FOP-pdf-images doesn't resize/rescale PDFs it only crops.

Hope that helps

Mehdi


On 17 June 2011 11:06, Theresa Jayne Forster ther...@inbrand.co.uk wrote:
 On a slightly different note can you use the FOP-pdf-images.jar to extract
 thumbnails of PDFs?

 Kindest regards


 Theresa Forster
 Senior Software Developer

 -Original Message-
 From: mehdi houshmand [mailto:med1...@gmail.com]
 Sent: 17 June 2011 08:00
 To: fop-users@xmlgraphics.apache.org
 Subject: Re: Error including a PDF inside another PDF

 Hi Jose,

 The ERROR message is the key here, it's indicative of an absence of an
 image loader for PDFs. You need to have the FOP-pdf-images JAR to your
 class path, you can get the JAR from this link
 http://www.jeremias-maerki.ch/download/fop/pdf-images/ and to put it
 in your class path, the easiest way would be to drop the jar in your
 lib/ folder.

 Hope that helps

 Mehdi



 -
 To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
 For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org



-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org



RE: Error including a PDF inside another PDF

2011-06-17 Thread Theresa Jayne Forster
But can it be used to extract the front page as an image?

We can rescale later...

Kindest regards


Theresa Forster
Senior Software Developer

-Original Message-
From: mehdi houshmand [mailto:med1...@gmail.com] 
Sent: 17 June 2011 11:17
To: fop-users@xmlgraphics.apache.org
Subject: Re: Error including a PDF inside another PDF

Hi Theresa,

To put it simply, no. As far as I'm aware and I've done some testing
of this, FOP-pdf-images doesn't resize/rescale PDFs it only crops.

Hope that helps

Mehdi





-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org



Re: Error including a PDF inside another PDF

2011-06-17 Thread mehdi houshmand
Hi Theresa,

Yes, it can place the font page of one document and place it in
another, this may help you
http://old.nabble.com/-ANN--PDF-image-plug-in-for-Apache-FOP-version-2.0-released-td30077148.html/.

Hope that helps

Mehdi

On 17 June 2011 11:49, Theresa Jayne Forster ther...@inbrand.co.uk wrote:
 But can it be used to extract the front page as an image?

 We can rescale later...

 Kindest regards


 Theresa Forster
 Senior Software Developer

 -Original Message-
 From: mehdi houshmand [mailto:med1...@gmail.com]
 Sent: 17 June 2011 11:17
 To: fop-users@xmlgraphics.apache.org
 Subject: Re: Error including a PDF inside another PDF

 Hi Theresa,

 To put it simply, no. As far as I'm aware and I've done some testing
 of this, FOP-pdf-images doesn't resize/rescale PDFs it only crops.

 Hope that helps

 Mehdi





 -
 To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
 For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org



-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org



Re: Problems with FOP and image

2011-06-17 Thread Oscar.Flores

No i still can print the images in pdf in console what i do for now is call a
bat to make the transformation with fo until i figure out what the problem
is in log appear that can find a proper converter for the images

 
also another problem its that the table its to big it dont fit to the data
here its the pdf that result 
http://old.nabble.com/file/p31870136/Prueba3.pdf Prueba3.pdf 

 Warning(1979/26): fo:table, table-layout=auto is currently not supported
 by FOP
 but in my xslt it ike thisfo:table table-layout=fixed width=100%

the version of fop i use its 1.0 
 


Rob Sargent-4 wrote:
 
 I don't think you want to read and write to the same place. If the file 
 is where you want it to be and it's otherwise in perfect shape you 
 should be fine.  But if you do want to read it in and write it to some 
 deployed area the that's what you want to do. Almost:
  ImageIO.write(*newImage*, JPEG, jpegImageFile);
 
 So without adding the ImageIO.write() call, are you getting the pdf you 
 want yet?
 If not, what actual errors are you seeing in the logs.
 
 The warning about fo:table is not causing you any trouble.  What version 
 of fop are you running (sorry I've forgotten)
 
 
 
 
 
 
 On 06/15/2011 02:51 PM, Oscar.Flores wrote:
 Hi thanks for the help yeah i haven see that its was .java and not
 .class, ok
 then if i follow correctly what you are saying then it has to be
 something
 like this

 BufferedImage newImage = new BufferedImage (C:\Logo.jpg)
 ImageIO.write(BufferedImage, JPEG, jpegImageFile) jpegImageFile will be
 the XML call rigth something like C:\Logo.jpg)

 and another thing

Warning(1979/26): fo:table, table-layout=auto is currently not
 supported
 by FOP
 but in my xslt it ike thisfo:table table-layout=fixed width=100% 
 so
 i dont now what its causing the ploblem



 Rob Sargent-4 wrote:


 On 06/14/2011 11:06 AM, Oscar.Flores wrote:
 Yeah i do the class is in jai-imageio-1.1-sources.jar, the enviroment
 is
 just
 Having the file in the ...sources.jar won't do the runtime world much
 good. You need the jar of .class files for jai-imageio, not .java files
 windows xp, and the bufferedImage will be the path of the image??
 No, the bufferedImage is an in-memory instance of BufferedImage holding
 the bits of the image.  In the case that you have to read it from one
 place and write it to another.
 Rob Sargent-4 wrote:
 Did you go through all your jars looking for 
 'CLibJPEGImageReaderSpi'.
 My greatest suspicion is that you don't have all your jars lined up.
 Which jar(s) do you think supplies these?

 What is your environment: just windows or do you have any tools like
 cygwin?

 The jpegImageFile would be the filename in your xsl the
 external-resource.  If you're just using a file that is already in
 place
 you don't have to re-write it.



 On 06/14/2011 08:29 AM, Oscar.Flores wrote:
 No i dont, and that weird jejeje netbeans seems to do that for me, so
 the
 calls like ImageIO.write(BufferedImage, JPEG, jpegImageFile)? do i
 have
 to
 do it in every image that i put in the pdf?? and the image is
 gererate
 directly in the pdf??how can i do it??

 Rob Sargent-4 wrote:
 Some jar to which netbeans has access has those classes.  Look in
 the
 output of jar tvfeach of your jarsand see if any of those has
 the
 named classes.  If you find a jar with those classes make sure it's
 part
 of your classpath for you app.

 Are you making any calls like ImageIO.write(BufferedImage, JPEG,
 jpegImageFile)?

 On 06/13/2011 05:31 PM, Oscar.Flores wrote:
 ok i made a test and tell me that the class is missign but maybe
 what
 you
 say
 its rigth and it register the handler
 so i gonna register the services so i do this

  public static void main(String[] args) throws Exception {
  DOMConfigurator.configure(D:/Mis
 documentos/NetBeansProjects/Factura/src/factura/log4j.xml);
  logger.info(Entering application.);

 IIORegistry.getDefaultInstance().registerServiceProvider(new
 CLibJPEGImageReaderSpi());

 IIORegistry.getDefaultInstance().registerServiceProvider(new
 CLibJPEGImageWriterSpi());

 also after register my services it telling me that the class
 CLibJPEGImageReaderSpi() and CLibJPEGImageWriterSpi() is missing
 but
 only
 in
 command

 after register mi service, something more has to be done??


 Rob Sargent-4 wrote:
 I'm not sure I'm following correctly: does removing the
 xmlgraphics
 jar
 cause netbeans to behave the same as the command-line run of you
 app?
 If
 so, I suspect netbeans is registering services for you.  Your own
 code
 will have to make a call to one of the
 IIORegistry.registerServiceProvider() methods.

 On 06/13/2011 05:02 PM, Oscar.Flores wrote:
 Ok  i get it, actually the ImageIO library i added because i
 read
 in
 the
 xmlgrapics that if something like the message
 org.apache.xmlgraphics.image.loader.ImageException: Cannot load
 image
 (no
 suitable loader/converter combination available)appear i have to
 add
 the
 jar
 file to 

Re: Problems with FOP and image

2011-06-17 Thread Rob Sargent
Is the pdf you posted made via the .bat file then?  And it has all the 
images you need? Which image is giving you all the trouble?


I see that you are incorrectly sizing the area into which you are 
putting the address of the client. Alternatively you have placed the 
table of items too high.  Are you using fixed positions?
Those to pieces (client-address and invoice-items) should be in 
consecutive blocks.

On 06/17/2011 09:52 AM, Oscar.Flores wrote:

No i still can print the images in pdf in console what i do for now is call a
bat to make the transformation with fo until i figure out what the problem
is in log appear that can find a proper converter for the images


also another problem its that the table its to big it dont fit to the data
here its the pdf that result
http://old.nabble.com/file/p31870136/Prueba3.pdf Prueba3.pdf

  Warning(1979/26): fo:table, table-layout=auto is currently not supported

by FOP
but in my xslt it ike thisfo:table table-layout=fixed width=100%

the version of fop i use its 1.0



Rob Sargent-4 wrote:

I don't think you want to read and write to the same place. If the file
is where you want it to be and it's otherwise in perfect shape you
should be fine.  But if you do want to read it in and write it to some
deployed area the that's what you want to do. Almost:
  ImageIO.write(*newImage*, JPEG, jpegImageFile);

So without adding the ImageIO.write() call, are you getting the pdf you
want yet?
If not, what actual errors are you seeing in the logs.

The warning about fo:table is not causing you any trouble.  What version
of fop are you running (sorry I've forgotten)






On 06/15/2011 02:51 PM, Oscar.Flores wrote:

Hi thanks for the help yeah i haven see that its was .java and not
.class, ok
then if i follow correctly what you are saying then it has to be
something
like this

BufferedImage newImage = new BufferedImage (C:\Logo.jpg)
ImageIO.write(BufferedImage, JPEG, jpegImageFile) jpegImageFile will be
the XML call rigth something like C:\Logo.jpg)

and another thing

Warning(1979/26): fo:table, table-layout=auto is currently not
supported
by FOP
but in my xslt it ike thisfo:table table-layout=fixed width=100%
so
i dont now what its causing the ploblem



Rob Sargent-4 wrote:


On 06/14/2011 11:06 AM, Oscar.Flores wrote:

Yeah i do the class is in jai-imageio-1.1-sources.jar, the enviroment
is
just

Having the file in the ...sources.jar won't do the runtime world much
good. You need the jar of .class files for jai-imageio, not .java files

windows xp, and the bufferedImage will be the path of the image??

No, the bufferedImage is an in-memory instance of BufferedImage holding
the bits of the image.  In the case that you have to read it from one
place and write it to another.

Rob Sargent-4 wrote:

Did you go through all your jars looking for
'CLibJPEGImageReaderSpi'.
My greatest suspicion is that you don't have all your jars lined up.
Which jar(s) do you think supplies these?

What is your environment: just windows or do you have any tools like
cygwin?

The jpegImageFile would be the filename in your xsl the
external-resource.  If you're just using a file that is already in
place
you don't have to re-write it.



On 06/14/2011 08:29 AM, Oscar.Flores wrote:

No i dont, and that weird jejeje netbeans seems to do that for me, so
the
calls like ImageIO.write(BufferedImage, JPEG, jpegImageFile)? do i
have
to
do it in every image that i put in the pdf?? and the image is
gererate
directly in the pdf??how can i do it??

Rob Sargent-4 wrote:

Some jar to which netbeans has access has those classes.  Look in
the
output of jar tvfeach of your jars and see if any of those has
the
named classes.  If you find a jar with those classes make sure it's
part
of your classpath for you app.

Are you making any calls like ImageIO.write(BufferedImage, JPEG,
jpegImageFile)?

On 06/13/2011 05:31 PM, Oscar.Flores wrote:

ok i made a test and tell me that the class is missign but maybe
what
you
say
its rigth and it register the handler
so i gonna register the services so i do this

  public static void main(String[] args) throws Exception {
  DOMConfigurator.configure(D:/Mis
documentos/NetBeansProjects/Factura/src/factura/log4j.xml);
  logger.info(Entering application.);

IIORegistry.getDefaultInstance().registerServiceProvider(new
CLibJPEGImageReaderSpi());

IIORegistry.getDefaultInstance().registerServiceProvider(new
CLibJPEGImageWriterSpi());

also after register my services it telling me that the class
CLibJPEGImageReaderSpi() and CLibJPEGImageWriterSpi() is missing
but
only
in
command

after register mi service, something more has to be done??


Rob Sargent-4 wrote:

I'm not sure I'm following correctly: does removing the
xmlgraphics
jar
cause netbeans to behave the same as the command-line run of you
app?
If
so, I suspect netbeans is registering services for you.  Your own
code
will have to make a call to one of the
IIORegistry.registerServiceProvider() 

Re: dpi resolution pdf

2011-06-17 Thread veeragoni

Chris, I too have exactly same requirement! (change quality(dpi) of bitmap
images embedded in pdf output)
Is it possible to change the quality of the bitmap images in the PDF?
I am using FOP on windows (batch file execution like below). and provide the
settings for the image resolution in the FOPSettings.xml file
E:\PrintEngine\FOP-0.95fop.bat -d -q -c FOPSettings.xml XSLFOInput.fo
LowResolutionOutput.pdf


cbowditch wrote:
 
 alberto.priore wrote:
 Hi,
 
 Hi Alberto,
 
 I'm trying to change the dpi of the pdf that I'm going to produce.
 I try to config it from conf/fop.xconf and change the 2 lines:
   source-resolution72/source-resolution
   target-resolution72/target-resolution
 but nothing happend, the pdf did not change it's resolution.
 
 The source resolution is used for drawing images that have no resolution 
 or width/height information specified. Target resolution is used for 
 bitmap renderers such as the TIFF Renderer, see [1] for the documentation.
 
 The image that I've insert into did not change.
 I tried to change the dpi from command line from a batch but the result
 is
 the same.
 
 There can be a different to show the pdf in video screen and print it?
 
 How can I change the dpi and so produce a pdf of different quality?
 I'm using the apache FOP 0.95
 
 I'm not sure what you mean by the DPI of the PDF? PDF doesn't have a DPI 
 as such as it's just a collection of drawing commands to be interpretted 
 by the Viewer. Bitmap Images within the XSL-FO do have a resolution 
 however. Perhaps the quality of the bitmap images in the PDF is not what 
 you expected?
 
 
 thanks in advance
 
 Chris
 
 [1] 
 http://xmlgraphics.apache.org/fop/trunk/configuration.html#general-elements
 
 -
 To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
 For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
 
 
 

-- 
View this message in context: 
http://old.nabble.com/dpi-resolution-pdf-tp28447749p31870979.html
Sent from the FOP - Users mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org



Re: dpi resolution pdf

2011-06-17 Thread veeragoni

also how do we use renderer settings for pdf from the batch file? how do we
pass the renderer xml from command line (if i want to use additional
settings for pdf)?!


cbowditch wrote:
 
 alberto.priore wrote:
 Hi,
 
 Hi Alberto,
 
 I'm trying to change the dpi of the pdf that I'm going to produce.
 I try to config it from conf/fop.xconf and change the 2 lines:
   source-resolution72/source-resolution
   target-resolution72/target-resolution
 but nothing happend, the pdf did not change it's resolution.
 
 The source resolution is used for drawing images that have no resolution 
 or width/height information specified. Target resolution is used for 
 bitmap renderers such as the TIFF Renderer, see [1] for the documentation.
 
 The image that I've insert into did not change.
 I tried to change the dpi from command line from a batch but the result
 is
 the same.
 
 There can be a different to show the pdf in video screen and print it?
 
 How can I change the dpi and so produce a pdf of different quality?
 I'm using the apache FOP 0.95
 
 I'm not sure what you mean by the DPI of the PDF? PDF doesn't have a DPI 
 as such as it's just a collection of drawing commands to be interpretted 
 by the Viewer. Bitmap Images within the XSL-FO do have a resolution 
 however. Perhaps the quality of the bitmap images in the PDF is not what 
 you expected?
 
 
 thanks in advance
 
 Chris
 
 [1] 
 http://xmlgraphics.apache.org/fop/trunk/configuration.html#general-elements
 
 -
 To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
 For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
 
 
 

-- 
View this message in context: 
http://old.nabble.com/dpi-resolution-pdf-tp28447749p31871057.html
Sent from the FOP - Users mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org



Re: fop .95 PDF generation issue with IE 6 (working fine in IE7)

2011-06-17 Thread Chetan Shirol
Hi Jose,

I have set the content/type properly to PDF but still the issue is there.
Actually we are migrating from fop .25 to .95 and this migration has caused this
issue.

Please let me know if you have any other thoughts on this.

Regards,
Chetan V S



-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org



Re: flow sideways

2011-06-17 Thread Rob Sargent

This indent stuff very nearly does the trick, but not quite.

The outer edges of both pages are perfect, so the -negative start-indent 
on the right-hand page pulls the right edge of the table exactly where I 
want it (in line with the text margin of the page) by outdenting exactly 
half the table.  The left-hand page start correctly too but this isn't 
much of a surprise. :)


However the gutters near the spine are not respected.  I define my page 
margins as follows:


   xsl:variable name=leftPageMargins 0.0in 0.833in 0.6in
   0.0in/xsl:variable
   xsl:variable name=rightPageMargins0.0in 0.0in 0.6in
   0.833in/xsl:variable

hoping to have the table not write into the 0.833in gutters.  I define 
a margin-left/right on the region-body and region-before to set the 
outer edges correctly (there's even a good reason for doing this).


I've tried playing with the indent numbers but that only shifts the 
start point.


I've tried overflow=hidden on the region but this just gives me a 
completely blank area!?  No effect with overflow=hidden on the table 
data.  (Confession: the table of data is, for reasons long since lost, 
in a cell of a containing table but wrapping the table in a fo:block 
overflow=hidden doesn't help.)


I'm this close to setting color=white background-color=white in the 
last/first visible column but that kind of programming in xsl is just 
plain ugly.


So my initial objective has been accomplished: I can perfectly size all 
tables, including those which span facing pages.  I can show the table 
data as it would appear on each page.  I just show a little more than I 
would like.  This will have to do for now, until I gain the strength to 
do the white-on-white trick.  Other chores beckon at this point.


Cheers,




On 06/10/2011 10:23 AM, Vincent Hennebert wrote:

Hi Rob,

(Sorry for the delay.)

On 01/06/11 00:30, Rob Sargent wrote:

I have a table of data which is designed to span across two facing pages.
Thanks to the tip from Jeremias Maerki I can size the tables perfectly and
allot the correct space in the region-before or each page. But how do I get
the table to break across the two pages nicely?  Since the definition of
each line's depth my be determined by any column I cannot lay the two halves
out separately.  It would be cool if it would just flow nicely all by itself
but that's not quite how flow works far as I know.  Perhaps I could lay the
entire table in both region and have it truncate the left/right overflow?

That seems to me like the best way to achieve what you want. Normally
you just have to play with start-indent and end-indent on the table. You
can even set the other indent (end-indent or start-indent) to a negative
value to avoid FOP warnings. Something like this:
• for even pages:
   fo:table table-layout=fixed width=200%
 start-indent=0 end-indent=-100%
 fo:table-header start-indent=0 end-indent=0
   ...
 /fo:table-header
 fo:table-body start-indent=0 end-indent=0
   ...
 /fo:table-body
   /fo:table
• for odd pages:
   fo:table table-layout=fixed width=200%
 start-indent=-100% end-indent=0
 fo:table-header start-indent=0 end-indent=0
   ...
 /fo:table-header
 fo:table-body start-indent=0 end-indent=0
   ...
 /fo:table-body
   /fo:table

(You may have to adjust the width of the table a bit to account for its
borders.)



Seems possible for the left page, but would it work for the right hand page.
i.e. Can one force the region to in essence fill from the right.

Or is there a correct way to accomplish this?

All pointer welcome,

rjs

HTH,
Vincent

-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org