|
Re: Postscript Level and Tray selection Problem [message #840887 is a reply to message #840855] |
Tue, 10 April 2012 16:12 |
|
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 #840995 is a reply to message #840898] |
Tue, 10 April 2012 19:24 |
|
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 #841664 is a reply to message #841350] |
Wed, 11 April 2012 15:55 |
|
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
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03108 seconds