cancel
Showing results for 
Search instead for 
Did you mean: 

Printing PDF issue in MII 14.0

Former Member
0 Kudos

Hi Experts,


I am trying to write print PDF custom action block. I am saving the PDF image to a location and then printing the PDF. For this I have created a java process.I am able to print the PDF but AcroRD32.exe process is not getting destroyed. Because of this next time when I try to run and save the PDF image, I am getting error "The process cannot access the file because it is being used by another process" .

String str = "\"" + AdobeLocation + "\"" + " " + "/t" + " " + "\""

   + FilePath + "\"" + " " + "\"" + PrinterName + "\"";


Process p1 = Runtime.getRuntime().exec(str);

p1.destroy();

need yopur help in resolving this.

Thanks & Regards,

Eshwar.

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Why are you saving the file to a temporary location prior to printing it?  Why are you not saving it as a unique filename each time and then using the File I/O -> Delete File action to clean it up after it's done printing?


Sam

PS:  I have already written a "File Runner" action block for MII and it's on the MII Wiki here (Customization - xMII - SCN Wiki) called File Runner Custom Action: http://scn.sap.com/docs/DOC-22962 and the associated document has the complete code of the action.

Former Member
0 Kudos

Hi Salvatore,

Thanks for the reply.

I am saving the file with unique name every time. It solved my problem.

Regards, Eshwar

Answers (0)