Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

[AEM Gems Webinar] Accelerating Experience Manager as a Cloud Service development with Rapid Development Environments
Adobe Summit 2023 | Complete list of AEM Sessions & Labs

EJB api (PDFGAPI7.submitJob())converting pdf to ps usage

Avatar

Not applicable
I am using the PDFGAPI7.submitJob() method for PDF to PS conversion,following is the code ,as the 'jobConfiguration' parameter i have used 'PDFGAPI7.getPDFExportXML("PS", 0,null)' as mentioned by the api ,i am still not able to convert the 'pdf' to .ps, i get a 'The supplied post script has errors' even though i am passing a 'pdf' as the input and expecting a .ps as the output file.Is the api usage correct?

will appreciate ur comments



Hashtable propsJNDI = new Hashtable();

// Populate the Hashtable object with JNDI environment values

propsJNDI.put("java.naming.factory.initial","org.jnp.interfaces.NamingContextFactory");

propsJNDI.put("java.naming.provider.url","jnp://localhost:1099");

propsJNDI.put("java.naming.factory.url.pkgs","org.jboss.naming:org.jnp.interfaces");

InitialContext initialContextOb = new InitialContext(propsJNDI);

//Look up the default PDFGAPI7 home object using the default properties case,//and then create an EJBClient object for it.

Object homeObject = initialContextOb.lookup( PDFGAPI7Home.JNDI_NAME );

PDFGAPI7Home apiHome =( PDFGAPI7Home )PortableRemoteObject.narrow( homeObject,PDFGAPI7Home.class );

PDFGAPI7 apiBean=apiHome.create();



String pdfExportXML=apiBean.getPDFExportXML("PS", 0,null);//for pdf to other file conversions

AESAPIResults result= apiBean.submitJob("pdftoPsConversion",

new java.io.File("C:/Temp/test.pdf"),

"test.ps",

false,

pdfExportXML,

null,

9,

null,

null,

"en_US",

null);



This creates the directory C:\WINDOWS\Temp\pdfg-SYSTEM\20\fde3-fffbb5-dfab61-e655cd-10b4c4-fd76a1\destdir with 3 files

1)test.log,2)_error_( with the code '12011' as the content)

I was able to locate the code ('1009') in pdfg-all.ear >aes-common.jar>ErrorCodes.properties

"12011 = The supplied PostScript has errors.".This indicates the usage of api is wrong ,please do let me know the right usage .

3)_done_(has no content)
0 Replies

Avatar

Not applicable
Hi Sujith



I'm encountering the same problem you have only trying to convert the PDF to JPEG.

1) was your issue resolved ? if so how?

2) the call I am making is as follows:



ht.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");

ht.put(Context.PROVIDER_URL, "t3://grfnzts1srv:21968");

try {

initialContextOb = new InitialContext(ht);

if(initialContextOb == null){

System.out.println("null initial context");

}

//System.out.println("lookout start");

Object homeObject = initialContextOb.lookup( PDFGAPI7Home.JNDI_NAME );

//System.out.println("lookout complete");

PDFGAPI7Home apiHome =

( PDFGAPI7Home ) PortableRemoteObject.narrow( homeObject,

PDFGAPI7Home.class );

try {

PDFGAPI7 apiBean = apiHome.create();

i_xml = apiBean.getPDFExportXML("JPEG", 777, null);

//i_xml = jxml;



//System.out.println("\n\n\n"+i_xml);

File i_pdfFile = new File(a_sourceDir,a_fileName);

System.out.println("file name"+i_pdfFile.getPath()+"/"+i_pdfFile.getName());

AESAPIResults i_result = apiBean.submitJob(

"Convert JPEG",

i_pdfFile,

i_pdfFile.getName(),

false,

i_xml,

null,

APIConstants.DEFAULT_JOB_PRIORITY,

null,

null,

"Conversion DAEMON",

null);



I'm getting either:

The source file you submitted is not supported by this version of PDF Generator. (if I send the full path)

or

The system encountered an unexpected error while processing this request. Please contact the system administrator. C:\Documents and Settings\idank\My Documents\Tasks - code\YPG\ACL\pdf\InternalProofMask.pdf (The system cannot find the path specified) - if i give just the file name



your help on the matter would be great



Thank you



Idan Koch