Skip to main content



      Home
Home » Archived » BIRT » PDF output and StyleSheets
PDF output and StyleSheets [message #241268] Wed, 06 June 2007 02:58 Go to next message
Eclipse UserFriend
Hello everyone.

Is it possible to instruct the PDF emitter to use an existing
stylesheet? The html version of my report uses a stylesheet and I would
like the same happens for my generated pdf output.

Many thanks,
Ali.
Re: PDF output and StyleSheets [message #241696 is a reply to message #241268] Fri, 08 June 2007 02:42 Go to previous message
Eclipse UserFriend
Originally posted by: firstname.lastname.napa.fi

On Wed, 06 Jun 2007 09:58:14 +0300, Ali Naddaf <ali@naddaf.org> wrote:

> Is it possible to instruct the PDF emitter to use an existing =

> stylesheet? The html version of my report uses a stylesheet and I woul=
d =

> like the same happens for my generated pdf output.

You can import the styles from a style sheet into birt. You can then =
=

assign those styles to your text elements.

Also this feature request may be something you might want to watch:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=3D189409

Have a look at this Birt World article, too:
http://birtworld.blogspot.com/2006/04/get-some-style.html


I don't think you can instruct the emitter itself to use a style shee=
t, =

but it is pretty simple to programmatically set the styles from a style =
=

sheet, e.g. like this:

CssStyleSheetHandle cssHandle ;
try {
cssHandle =3D design.openCssStyleSheet( new =

BufferedInputStream( css.openStream() ) );
} catch ( StyleSheetException e ) {
throw new RuntimeException e ) ;
} catch ( IOException e ) {
throw new RuntimeException( e ) ;
}
List<SharedStyleHandle> importedStyles =3D new =

ArrayList<SharedStyleHandle>() ;
Iterator styleIterator =3D cssHandle.getStyleIterator() ;
while ( styleIterator.hasNext() ) =

importedStyles.add( (SharedStyleHandle)styleIterator.next() ) ;

design.importCssStyles( cssHandle, importedStyles ) ;


Naturally you have to do this before rendering.



-Antti-
Previous Topic:ChartWizardLauncher , scripted data source
Next Topic:How to open BIRT Report designer in Eclipse RCP
Goto Forum:
  


Current Time: Mon Jun 09 00:31:40 EDT 2025

Powered by FUDForum. Page generated in 0.03635 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top