Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Postscript Level and Tray selection Problem(Unable to change ps level and select tray)
Postscript Level and Tray selection Problem [message #840855] Tue, 10 April 2012 15:36 Go to next message
CHETAN KAKKAR is currently offline CHETAN KAKKARFriend
Messages: 6
Registered: April 2012
Junior Member
Hi,
I have tried and searched over the internet as how to change the postscript level and add tray selection postscript directives to the generated postscript report.

Sample code:
PostscriptRenderOption optionss = new PostscriptRenderOption();
optionss.setOutputFileName("C:\\Chetan\\" + c.getPlanNumber()
+".ps");
optionss.setOutputFormat("postscript");
optionss.setPostscriptLevel(2);
optionss.setPaperTray("TRAY1 595.2 841.8 0");

This doesnt seem to work and gives output like

%!PS-Adobe-3.0
% (C)2006 Actuate Inc.
%%Creator: Chetan Kakkar
%%Pages: (atend)
%%DocumentProcessColors: Black
%%BeginSetup
%%BeginFeature: *Duplex null
<</Duplex true /Tumble false>> setpagedevice
%%EndFeature
%%BeginResource: procset BIRTProcs
%%Title: Utility procedures

while I want something like this


%!PS-Adobe-2.1
%%LanguageLevel: 2
%%Requirements:
%%DocumentMedia: TRAY1 595.2 841.8 0 white PINK
%%+ TRAY2 595.2 841.8 0 white LETTERHEAD
%%+ TRAY3 595.2 841.8 0 white PLAIN
%%+ TRAY4 595.2 841.8 0 white PREPRINTED
%%Pages: 8
%%EndComments
%%BeginProlog




Kindly suggest where I'm going wrong, it'svery urgent as it is part of a Proof-of Concept stage for using BIRT for our purposes.

Regards,
Chetan Kakkar
Re: Postscript Level and Tray selection Problem [message #840887 is a reply to message #840855] Tue, 10 April 2012 16:12 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

I have not done much work with the ps emitter but from the code it looks
like tray settings are set like:

out.println( "%%BeginFeature: *InputSlot tray1" );
out.println( trayString );
out.println( "%%EndFeature" );

Where trayString is what you set in the options

PostscriptRenderOption options = new PostscriptRenderOption();
options.setOutputFormat("postscript");
options.setPaperTray("Tray1");
options.setOutputFileName("output/resample/tst.ps");
task.setRenderOption(options);

Jason

On 4/10/2012 11:36 AM, CHETAN KAKKAR wrote:
> Hi,
> I have tried and searched over the internet as how to change the
> postscript level and add tray selection postscript directives to the
> generated postscript report.
>
> Sample code:
> PostscriptRenderOption optionss = new PostscriptRenderOption();
> optionss.setOutputFileName("C:\\Chetan\\" + c.getPlanNumber()
> +".ps");
> optionss.setOutputFormat("postscript");
> optionss.setPostscriptLevel(2);
> optionss.setPaperTray("TRAY1 595.2 841.8 0");
>
> This doesnt seem to work and gives output like
>
> %!PS-Adobe-3.0
> % (C)2006 Actuate Inc.
> %%Creator: Chetan Kakkar
> %%Pages: (atend)
> %%DocumentProcessColors: Black
> %%BeginSetup
> %%BeginFeature: *Duplex null
> <</Duplex true /Tumble false>> setpagedevice
> %%EndFeature
> %%BeginResource: procset BIRTProcs
> %%Title: Utility procedures
> while I want something like this
>
>
> %!PS-Adobe-2.1
> %%LanguageLevel: 2
> %%Requirements:
> %%DocumentMedia: TRAY1 595.2 841.8 0 white PINK
> %%+ TRAY2 595.2 841.8 0 white LETTERHEAD
> %%+ TRAY3 595.2 841.8 0 white PLAIN
> %%+ TRAY4 595.2 841.8 0 white PREPRINTED
> %%Pages: 8
> %%EndComments
> %%BeginProlog
>
>
>
>
> Kindly suggest where I'm going wrong, it'svery urgent as it is part of a
> Proof-of Concept stage for using BIRT for our purposes.
>
> Regards,
> Chetan Kakkar
Re: Postscript Level and Tray selection Problem [message #840898 is a reply to message #840887] Tue, 10 April 2012 16:35 Go to previous messageGo to next message
CHETAN KAKKAR is currently offline CHETAN KAKKARFriend
Messages: 6
Registered: April 2012
Junior Member
HI Jason, thanks for the quick reply. Yeah I went through the api as well...but that block of statements

out.println( "%%BeginFeature: *InputSlot tray1" );
out.println( trayString );
out.println( "%%EndFeature" );

is not found in the postscript generated. I'm unable to guess how to achieve it.
Thanks,
Chetan
Re: Postscript Level and Tray selection Problem [message #840995 is a reply to message #840898] Tue, 10 April 2012 19:24 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

What version of BIRT are you using? This is what my output looked like:

%!PS-Adobe-3.0
% (C)2006 Actuate Inc.
%%Pages: (atend)
%%DocumentProcessColors: Black
%%BeginSetup
%%BeginFeature: *InputSlot tray1
Tray1
%%EndFeature
..
..
..
I put "Tray1" in.

Jason


On 4/10/2012 12:35 PM, CHETAN KAKKAR wrote:
> HI Jason, thanks for the quick reply. Yeah I went through the api as
> well...but that block of statements
> out.println( "%%BeginFeature: *InputSlot tray1" );
> out.println( trayString );
> out.println( "%%EndFeature" );
>
> is not found in the postscript generated. I'm unable to guess how to
> achieve it. Thanks,
> Chetan
Re: Postscript Level and Tray selection Problem [message #841295 is a reply to message #840995] Wed, 11 April 2012 06:08 Go to previous messageGo to next message
CHETAN KAKKAR is currently offline CHETAN KAKKARFriend
Messages: 6
Registered: April 2012
Junior Member
Hi Jason,

I'm using BIRT runtime API jars to integrate it with my standalone java application(org.eclipse.birt.runtime_3.7.2.v20120214-1408 - name of jar) and the Eclipse IDE for Report Designing. The version of the BIRT runtime is '3.7.2'.


I tried changing the Papersize and it works. But not for the Postscript Language Level and Tray.

ADded this

optionss.setPostscriptLevel(2);
optionss.setPaperSize("LETTERHEAD");
optionss.setPaperTray("TRAY2");

Output:
%%BeginFeature: *PageSize LETTERHEAD
<</PageSize [595 842] /ImagingBBox null>> setpagedevice
%%EndFeature
%%BeginFeature: *Duplex null
<</Duplex true /Tumble false>> setpagedevice
%%EndFeature

Regards,
Chetan
Re: Postscript Level and Tray selection Problem [message #841350 is a reply to message #840855] Wed, 11 April 2012 07:30 Go to previous messageGo to next message
CHETAN KAKKAR is currently offline CHETAN KAKKARFriend
Messages: 6
Registered: April 2012
Junior Member
Hi Jason,

I'm using BIRT runtime API jars to integrate it with my standalone java application(org.eclipse.birt.runtime_3.7.2.v20120214-1408 - name of jar) and the Eclipse IDE for Report Designing. The version of the BIRT runtime is '3.7.2'.


I tried changing the Papersize and it works. But not for the Postscript Language Level and Tray.

ADded this

optionss.setPostscriptLevel(2);
optionss.setPaperSize("LETTERHEAD");
optionss.setPaperTray("TRAY2");

Output:
%%BeginFeature: *PageSize LETTERHEAD
<</PageSize [595 842] /ImagingBBox null>> setpagedevice
%%EndFeature
%%BeginFeature: *Duplex null
<</Duplex true /Tumble false>> setpagedevice
%%EndFeature

Regards,
Chetan
Re: Postscript Level and Tray selection Problem [message #841664 is a reply to message #841350] Wed, 11 April 2012 15:55 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

For some reason there was a change on the tray setting from BIRT 3.7.1
to 3.7.2. The setting is now an integer instead of a string and the
setter does not appear to be updated. Can you log a bugzilla entry for
this?

I was able to get a tray entry like:

options.setOption(PostscriptRenderOption.OPTION_PAPER_TRAY, new
Integer(258));

This generated:

%%BeginFeature: *InputSlot tray1
<</ManualFeed false /MediaPosition 1 /TraySwitch false>>setpagedevice
%%EndFeature


Here is the source that determines the string for 3.7.2

private void setPaperTray( int paperTray )
{
String trayString = getPaperTrayCode( paperTray );
if ( trayString != null )
{
out.println( "%%BeginFeature: *InputSlot tray1" );
out.println( trayString );
out.println( "%%EndFeature" );
}
}

private String getPaperTrayCode( int paperTray )
{
if ( paperTray == TRAYCODE_MANUAL )
{
return "<</ManualFeed true /TraySwitch false>>setpagedevice";
}
// tray code should be positive number
// bigger than
// 257. For some printers use 257 and /MediaPosition
// 0 for first printer, whiles some others printers
// use code 258 and /MediaPosition 1 for first paper
// tray.
paperTray = paperTray - 257;
if ( paperTray < 0 )
{
return null;
}
return "<</ManualFeed false /MediaPosition " + paperTray
+ " /TraySwitch false>>setpagedevice";
}


It looks like from the emitter source:
out.println( "%!PS-Adobe-3.0" );

is hard coded.


Jason

On 4/11/2012 3:30 AM, CHETAN KAKKAR wrote:
> Hi Jason,
>
> I'm using BIRT runtime API jars to integrate it with my standalone java
> application(org.eclipse.birt.runtime_3.7.2.v20120214-1408 - name of jar)
> and the Eclipse IDE for Report Designing. The version of the BIRT
> runtime is '3.7.2'.
>
> I tried changing the Papersize and it works. But not for the Postscript
> Language Level and Tray.
>
> ADded this
>
> optionss.setPostscriptLevel(2);
> optionss.setPaperSize("LETTERHEAD");
> optionss.setPaperTray("TRAY2");
>
> Output:
> %%BeginFeature: *PageSize LETTERHEAD
> <</PageSize [595 842] /ImagingBBox null>> setpagedevice
> %%EndFeature
> %%BeginFeature: *Duplex null
> <</Duplex true /Tumble false>> setpagedevice
> %%EndFeature
>
> Regards,
> Chetan
Re: Postscript Level and Tray selection Problem [message #841679 is a reply to message #841664] Wed, 11 April 2012 16:11 Go to previous messageGo to next message
CHETAN KAKKAR is currently offline CHETAN KAKKARFriend
Messages: 6
Registered: April 2012
Junior Member
Hi Jason,

Again many thanks for the quick response. I'll try the way you have implemented the tray setting and update you. Yes, I'll raise a bugzilla request for the same and post the id here as well.

Thanks again for the help.

Cheers,
Chetan
Re: Postscript Level and Tray selection Problem [message #1060068 is a reply to message #841679] Wed, 22 May 2013 20:28 Go to previous message
Jesse Weinstein is currently offline Jesse WeinsteinFriend
Messages: 44
Registered: July 2012
Member
The postscript level option appears to have never been implemented. See: https://bugs.eclipse.org/bugs/show_bug.cgi?id=169053#c2
Previous Topic:Postscript Level BIRT 2.2RC2
Next Topic:first report totals, then select parameter and filter
Goto Forum:
  


Current Time: Thu Nov 27 06:01:12 GMT 2014

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

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