You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Martin Edge <Ma...@intellimail.com.au> on 2010/06/30 15:59:15 UTC

transparency in images

Hey Guys,

 

Quick question - if I use a PNG as an image, is it's transparency properties
taken into account?

 

I am attempting to insert a PDF file as in within my document, however using
the PDF plugin, means it doesn't seem to happily output on postscript, so I
have had to convert the file to a JPG and use that. 

 

I generate barcodes and other information that sites on the outside of the
document, so if I use the image for the full page, it blanks out the barcode
and other text, and by shrinking the form it looks a little silly.

 

So, I was thinking, if transparency works, would I be able to see the
barcode, given it's in theory underneath the image?

 

Thanks

Martin

 

 


Re: transparency in images

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
On 30.06.2010 16:39:27 Martin Edge wrote:
> Hey Jeremias,
> 
> Bugger on the transparency - I suppose the printer would need to know how to
> deal with it. 
> 
> The reason I'm using postscript (and thankfully no longer PCL :)) - is I
> configure tray selections and duplexing, and PDF can't easily help me there.
> 
> 
> I will give your latest snapshot a try and see what happens - (I dont think
> I have a particularly old version) - and I will see how we go. 
> 
> As far as the painting of the barcode, I currently store it in the
> region-start, config as such;
> 
>        <fo:simple-page-master master-name="basicPage" page-height="297mm"
> page-width="210mm" margin-top="5mm" margin-bottom="5mm" margin-left="0mm"
> margin-right="3mm">
>           <fo:region-body margin-top="0mm" margin-bottom="5mm"
> margin-left="8mm" margin-right="0mm" />
>           <fo:region-after extent="5mm" />
>           <fo:region-start extent="8mm" />
>         </fo:simple-page-master>
> 
> So I suppose my options in this regard are;
> 1) see if there is a way to control which region gets loaded when (does
> order have any importance within the simple-page-master?)

FOP can't handle z-index, yet. :-(

> 2) Try to move what I currently use within region-start into region-body 

That's what I recommend if that's possible with your document. Then you
could use a fixed positioned block-container (absolute-position="fixed").

Option 3) Reorder the region-before after the region-body in the
intermediate format. Yuck. ;-)

> Will see how we go, if you have any advice on my two options, I'd love to
> hear it - might save me some time ;)
> 
> On a separate note; as I'm learning different printers I'm finding
> Postscript command docs - would shortcuts on how to achieve certain goals
> using some printers have some value on the wiki ?

Useful content for the Wiki is always welcome.

> Thanks!
> Martin
> 
> 
> 
> -----Original Message-----
> From: Jeremias Maerki [mailto:dev@jeremias-maerki.ch] 
> Sent: Thursday, 1 July 2010 12:26 AM
> To: fop-users@xmlgraphics.apache.org
> Subject: Re: transparency in images
> 
> Hi Martin
> 
> First problem: PostScript doesn't support transparency. It only supports
> image masks using an array of mask colors, but that's not currently
> implemented in FOP. PDF has support for both and both are available in
> FOP.
> 
> The latest snapshot of my PDF plugin supports rendering PDF to
> PostScript (and every other output format supported by FOP) but only as
> far as Apache PDFBox can handle the PDF minus some potential
> restrictions of our PSGraphics2D.
> 
> Can't you try to paint the barcode and such after the page content so it
> lies above the original content?
> 
> On 30.06.2010 15:59:15 Martin Edge wrote:
> > Hey Guys,
> >  
> > Quick question - if I use a PNG as an image, is it's transparency
> properties
> > taken into account?
> >  
> > I am attempting to insert a PDF file as in within my document, however
> using
> > the PDF plugin, means it doesn't seem to happily output on postscript, so
> I
> > have had to convert the file to a JPG and use that. 
> >  
> > I generate barcodes and other information that sites on the outside of the
> > document, so if I use the image for the full page, it blanks out the
> barcode
> > and other text, and by shrinking the form it looks a little silly.
> >  
> > So, I was thinking, if transparency works, would I be able to see the
> > barcode, given it's in theory underneath the image?
> >  
> > Thanks
> > Martin
> 
> 
> 
> Jeremias Maerki
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org




Jeremias Maerki


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


RE: transparency in images

Posted by Martin Edge <Ma...@intellimail.com.au>.
Hey Jeremias,

Bugger on the transparency - I suppose the printer would need to know how to
deal with it. 

The reason I'm using postscript (and thankfully no longer PCL :)) - is I
configure tray selections and duplexing, and PDF can't easily help me there.


I will give your latest snapshot a try and see what happens - (I dont think
I have a particularly old version) - and I will see how we go. 

As far as the painting of the barcode, I currently store it in the
region-start, config as such;

       <fo:simple-page-master master-name="basicPage" page-height="297mm"
page-width="210mm" margin-top="5mm" margin-bottom="5mm" margin-left="0mm"
margin-right="3mm">
          <fo:region-body margin-top="0mm" margin-bottom="5mm"
margin-left="8mm" margin-right="0mm" />
          <fo:region-after extent="5mm" />
          <fo:region-start extent="8mm" />
        </fo:simple-page-master>

So I suppose my options in this regard are;
1) see if there is a way to control which region gets loaded when (does
order have any importance within the simple-page-master?)
2) Try to move what I currently use within region-start into region-body 

Will see how we go, if you have any advice on my two options, I'd love to
hear it - might save me some time ;)

On a separate note; as I'm learning different printers I'm finding
Postscript command docs - would shortcuts on how to achieve certain goals
using some printers have some value on the wiki ?

Thanks!
Martin



-----Original Message-----
From: Jeremias Maerki [mailto:dev@jeremias-maerki.ch] 
Sent: Thursday, 1 July 2010 12:26 AM
To: fop-users@xmlgraphics.apache.org
Subject: Re: transparency in images

Hi Martin

First problem: PostScript doesn't support transparency. It only supports
image masks using an array of mask colors, but that's not currently
implemented in FOP. PDF has support for both and both are available in
FOP.

The latest snapshot of my PDF plugin supports rendering PDF to
PostScript (and every other output format supported by FOP) but only as
far as Apache PDFBox can handle the PDF minus some potential
restrictions of our PSGraphics2D.

Can't you try to paint the barcode and such after the page content so it
lies above the original content?

On 30.06.2010 15:59:15 Martin Edge wrote:
> Hey Guys,
>  
> Quick question - if I use a PNG as an image, is it's transparency
properties
> taken into account?
>  
> I am attempting to insert a PDF file as in within my document, however
using
> the PDF plugin, means it doesn't seem to happily output on postscript, so
I
> have had to convert the file to a JPG and use that. 
>  
> I generate barcodes and other information that sites on the outside of the
> document, so if I use the image for the full page, it blanks out the
barcode
> and other text, and by shrinking the form it looks a little silly.
>  
> So, I was thinking, if transparency works, would I be able to see the
> barcode, given it's in theory underneath the image?
>  
> Thanks
> Martin



Jeremias Maerki


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



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


Re: transparency in images

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
Hi Martin

First problem: PostScript doesn't support transparency. It only supports
image masks using an array of mask colors, but that's not currently
implemented in FOP. PDF has support for both and both are available in
FOP.

The latest snapshot of my PDF plugin supports rendering PDF to
PostScript (and every other output format supported by FOP) but only as
far as Apache PDFBox can handle the PDF minus some potential
restrictions of our PSGraphics2D.

Can't you try to paint the barcode and such after the page content so it
lies above the original content?

On 30.06.2010 15:59:15 Martin Edge wrote:
> Hey Guys,
>  
> Quick question - if I use a PNG as an image, is it's transparency properties
> taken into account?
>  
> I am attempting to insert a PDF file as in within my document, however using
> the PDF plugin, means it doesn't seem to happily output on postscript, so I
> have had to convert the file to a JPG and use that. 
>  
> I generate barcodes and other information that sites on the outside of the
> document, so if I use the image for the full page, it blanks out the barcode
> and other text, and by shrinking the form it looks a little silly.
>  
> So, I was thinking, if transparency works, would I be able to see the
> barcode, given it's in theory underneath the image?
>  
> Thanks
> Martin



Jeremias Maerki


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


RE: transparency in images

Posted by Eric Douglas <ed...@blockhouse.com>.
Don't use postscript.  I tried it and it got ugly, particularly on
specifying a font.
How are you calling FOP? command line? embedded code?
Here's what I'm doing (with embedded code) which works really cool.
I use the MIME-PDF to create a renderer to assign to the UserAgent.
Then I use the MIME_FOP_PRINT to create an FOP object using the factory
and pass it a ByteArrayOutputStream.
Then on my transform I get a PDF, but instead of a physical file I get a
byte stream.
I use this byte stream to create a PDDocument object from the pdfbox
project.
This gives me a pageable object I can pass in to
java.awt.print.PrinterJob.
I get a SEVICE_FORMATTED.PAGEABLE type javax.print.PrintService to
assign to the PrinterJob.
Then use PrinterJob.print, and between the attributes of the
PrintService and the PrinterJob you should be able to select the options
(print tray, duplex,etc).
 
If you can print it to a PDF you can use this method to print it to the
printer.  I haven't tested this transparency you mention, but I have
printed everything from variable size fonts and lines to SVG pictures
even on a dot matrix printer.

________________________________

From: Martin Edge [mailto:Martin.Edge@intellimail.com.au] 
Sent: Wednesday, June 30, 2010 9:59 AM
To: fop-users@xmlgraphics.apache.org
Subject: transparency in images



Hey Guys,

 

Quick question - if I use a PNG as an image, is it's transparency
properties taken into account?

 

I am attempting to insert a PDF file as in within my document, however
using the PDF plugin, means it doesn't seem to happily output on
postscript, so I have had to convert the file to a JPG and use that. 

 

I generate barcodes and other information that sites on the outside of
the document, so if I use the image for the full page, it blanks out the
barcode and other text, and by shrinking the form it looks a little
silly.

 

So, I was thinking, if transparency works, would I be able to see the
barcode, given it's in theory underneath the image?

 

Thanks

Martin