cancel
Showing results for
Did you mean:
25 Replies
Valued Member

## Re: Save/Export to EPS

This works perfectly, thak You one more time for Your help :)

FreeFlow User

## Re: Save/Export to EPS

I don't have that issue. Perhaps your Acrobat holds on to it for some reason. Try this:

Remove the Save node from the workflow and change the script like this to get the pdf directly from sys.argv[1] - $FFin$:

import os
import sys
import winerror

#my_dir = r"C:\Out"
my_dir = os.path.dirname(sys.argv[1])
#my_pdf = sys.argv[3] + ".pdf"
my_pdf = os.path.basename(sys.argv[1])
out_dir = r"C:\Out"
#my_pdf = "test.pdf"

os.chdir(my_dir)
src=os.path.abspath(my_pdf)

try:
AvDoc = Dispatch("AcroExch.AVDoc")

if AvDoc.Open(src, ""):
pdDoc = AvDoc.GetPDDoc()
jsObject = pdDoc.GetJSObject()

except Exception as e:
print(str(e))

finally:
AvDoc.Close(True)

jsObject = None
pdDoc = None
AvDoc = None

Valued Member

## Re: Save/Export to EPS

It works as it should but i have one problem, I cant delete PDF from C:\Out after script saves EPS. It says that the file is opened.

Valued Member

## Re: Save/Export to EPS

Thank You for Your help, in my case error was becouse I have Python in other location and I have to change it it .bat file. I will check if everything work as it shoud today.

FreeFlow User

## Re: Save/Export to EPS

A couple of more notes. I noticed that the resulting EPS was different when running the Python script standalone versus in a FreeFlow Core workflow. To be able to use the settings for the EPS conversion in Acrobat I had to set the FreeFlow Core Windows service user to the same user creating the EPS conversion settings in Acrobat. In Acrobat go to Edit->Preferences->General->Convert From PDF->Encapsulated PostScript->Edit settings and select your required settings. You might need to change the Security settings also to allow Acrobat to be run by some other application or user than what is default. Right click on Acrobat.exe and check the Security tab (I simply set it to full control for all application packages and users). Once you have created the EPS from Python standalone or if you did the same in a FreeFlow Core workflow, then open the created EPS in some text editor. In the first few lines you should see who the file was created for (%%For:).

%%Title: test.pdf
%%For: <user name>

FreeFlow User

## Re: Save/Export to EPS

This works for me...

First a Save node

Then an External Process

Where the batch file looks like this:

"C:\Program Files\Python38\python.exe" "C:\Xerox\FreeFlow\Core\00000000-0000-0000-0000-000000000000\Data\Scripts\save_as_eps_from_acrobat_pro_dc.py" %1 %2 %3

and the Python script like this:

import os
import sys
import winerror

my_dir = r"C:\Out"
my_pdf = sys.argv[3] + ".pdf"
#my_pdf = "test.pdf"

os.chdir(my_dir)
src=os.path.abspath(my_pdf)

try:
AvDoc = Dispatch("AcroExch.AVDoc")

if AvDoc.Open(src, ""):
pdDoc = AvDoc.GetPDDoc()
jsObject = pdDoc.GetJSObject()

except Exception as e:
print(str(e))

finally:
AvDoc.Close(True)

jsObject = None
pdDoc = None
AvDoc = None

/Stefan

Valued Member

## Re: Save/Export to EPS

OK, this "manual" script works, how to make it works with Core?

FreeFlow User

## Re: Save/Export to EPS

I have Acrobat Pro DC 2020. Try running it oustide FFCore first just with Python only and without a batch file. I run it like this, where I have a test pdf C:\Out\test.pdf and the result I get after running this with Python is an EPS C:\Out\test.eps

import os
import sys
import winerror

my_dir = r"C:\Out"
#my_pdf = sys.argv[3] + ".pdf"
my_pdf = "test.pdf"

os.chdir(my_dir)
src=os.path.abspath(my_pdf)

try:
AvDoc = Dispatch("AcroExch.AVDoc")

if AvDoc.Open(src, ""):
pdDoc = AvDoc.GetPDDoc()
jsObject = pdDoc.GetJSObject()

except Exception as e:
print(str(e))

finally:
AvDoc.Close(True)

jsObject = None
pdDoc = None
AvDoc = None

Valued Member

## Re: Save/Export to EPS

OK, now when i try:

PS C:\Xerox\FreeFlow\Core\00000000-0000-0000-0000-000000000000\Data\Scripts> python save_as_eps_from_acrobat_pro_dc.py "C:\in\testCIECIE.pdf" "C:\Out" "testCIECIE"

Am I giving paramterers correctly?

edit I have Adobe Acrobat 2017, meaby this is an issue?

FreeFlow User