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 Saurabh <sh...@musc.edu> on 2011/09/20 21:49:13 UTC

Re: How to create version 2.0 PS files

Jeremias Maerki <dev <at> jeremias-maerki.ch> writes:

> 
> Hi Adrian & Frank,
> 
> please note that "%!PS-Adobe-3.0" does not refer to the PostScript
> language level but to the version of the DSC specification which is 3.0.
> The language level is given by the following DSC comment:
> 
> %%LanguageLevel: 2
> 
> So this is no bug.
> 
> On 01.04.2009 11:11:30 Adrian Cumiskey wrote:
> > Hi Frank,
> > 
> > I don't think you are missing anything, I think it may be a bug.  Having 
> > stepped through the code, "%!PS-Adobe-3.0" is always written as the 
> > first line of the header regardless of the language level.  Could you 
> > please send us a bug report at 
> > https://issues.apache.org/bugzilla/enter_bug.cgi?product=Fop and someone 
> > will take a look at the problem.  I'll try to find some time later this 
> > week.
> > 
> > Thanks,
> > 
> > Adrian.
> > 
> > Frank Niedermann wrote:
> > > Hi Adrian,
> > >
> > > thanks for the link. This is my fopConfiguration.xml file:
> > > <fop>
> > >   <renderers>
> > >     <renderer mime="application/postscript">
> > >       <auto-rotate-landscape>true</auto-rotate-landscape>
> > >       <language-level>2</language-level>
> > >     </renderer>
> > >   </renderers>
> > > </fop>
> > >
> > > And this is how I load this configuration file:
> > > String fopConfiguration = "fopConfiguration.xml";
> > > FopFactory fopFactory = FopFactory.newInstance();
> > > fopFactory.setUserConfig(new File(fopConfiguration));
> > > FOUserAgent foUserAgent = fopFactory.newFOUserAgent();
> > >
> > > But it still creates version 3 PS-files (I checked the header).
> > >
> > > Am I missing something else?
> > >
> > > Thanks,
> > >   Frank
> > >
> > >
> > > Adrian Cumiskey-2 wrote:
> > >   
> > >> Hi Frank,
> > >>
> > >> Yes, you can do this with the language-level configuration option (see 
> > >> http://xmlgraphics.apache.org/fop/0.95/output.html#ps-configuration).
> > >>
> > >> Adrian.
> > >>
> > >> Frank Niedermann wrote:
> > >>     
> > >>> Hi,
> > >>>
> > >>> we are using Apache FOP to create PS files which should be printed on a
> > >>> HP-Unix machine.
> > >>>
> > >>> Unfortunately this machine only supports version 2.0 PS files:
> > >>> %!PS-Adobe-2.0
> > >>>
> > >>> Apache FOP creates version 3.0 PS files which are ignored by the HP-Unix
> > >>> print system.
> > >>>
> > >>> Is there a way to tell FOP to generate version 2.0 PS files?
> > >>>
> > >>> Thanks,
> > >>>   Frank
> > >>>
> > >>>   
> > >>>       
> 
> Jeremias Maerki
> 

 have embedded fop with java and loading the config using external config file:
I have set the language level to 2 but still get level 3 ps.
Java code:
DefaultConfigurationBuilder cfgBuilder = new DefaultConfigurationBuilder();
			File f = new File("D:/alfresco/module/rpms/fopConfig.xml");
			Configuration cfg = cfgBuilder.buildFromFile(f);
			fopFactory.setUserConfig(cfg);
			FOUserAgent foUserAgent = fopFactory.newFOUserAgent();

xml file:
<fop version="0.94">

  <!-- Strict user configuration -->
  <strict-configuration>true</strict-configuration>

  <!-- Strict FO validation -->
  <strict-validation>false</strict-validation>

  <!-- Base URL for resolving relative URLs -->
  <base>./</base>

  <!-- Font Base URL for resolving relative font URLs -->
  <font-base>./</font-base>

  <!-- Source resolution in dpi (dots/pixels per inch) for determining the size
of pixels in SVG and bitmap images, default: 72dpi -->
  <source-resolution>72</source-resolution>
  <!-- Target resolution in dpi (dots/pixels per inch) for specifying the target
resolution for generated bitmaps, default: 72dpi -->
  <target-resolution>72</target-resolution>

  <!-- default page-height and page-width, in case
       value is specified as auto -->
  <default-page-settings height="11in" width="8.26in"/>
  <renderers> 
	    <renderer mime="application/postscript">
		  <auto-rotate-landscape>false</auto-rotate-landscape>
		  <language-level>2</language-level>
		  <optimize-resources>false</optimize-resources>
		  <safe-set-page-device>false</safe-set-page-device>
		  <dsc-compliant>true</dsc-compliant>
		</renderer>
	</renderers>
</fop>

result:
%%Creator: (Apache FOP Version 0.94)
%%CreationDate: 2011-09-20T15:34:02
%%LanguageLevel: 3
%%Pages: (atend)
%%DocumentSuppliedResources: (atend)
%%EndComments
%%BeginDefaults
%%EndDefaults
%%BeginProlog
%%BeginResource: procset (Apache XML Graphics Std ProcSet) 1.0 0
%%Version: 1.0 0
%%Copyright: (Copyright 2001-2003 The Apache Software Foundation. License terms:
http://www.apache.org/licenses/LICENSE-2.0)
%%Title: (Basic set of procedures used by the XML Graphics project \(Batik and
FOP\))





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