Copy link to clipboard
Copied
I have a PDF file as below image:
I want export 2 Pages to 2 Images:
With Acrobat Script or COM : Can export a Page to a image ? and Can it remove white area?
Thank you.
You can use the JavaScript method saveAs to save all the pages of the file as images. If you want to only save two pages you can first extract them from the main file, and then save them. You would need to specify the cConvID parameter as "com.adobe.acrobat.jpeg" to force it to be saved as an image.
You might be able to remove the white space using the Preflight tool, before saving the pages as images.
Copy link to clipboard
Copied
You can use the JavaScript method saveAs to save all the pages of the file as images. If you want to only save two pages you can first extract them from the main file, and then save them. You would need to specify the cConvID parameter as "com.adobe.acrobat.jpeg" to force it to be saved as an image.
You might be able to remove the white space using the Preflight tool, before saving the pages as images.
Copy link to clipboard
Copied
Can saveAs call from vb.net?
my code can't save image:
Dim formApp As Object
formApp = CreateObject("AFormAut.App")
' access fields object inside AcroForm.
Dim fields As Object
fields = formApp.fields
Dim strScript As String
strScript = "this.saveAs(""myDoc.jpeg"", ""com.adobe.acrobat.jpeg"");"
fields.ExecuteThisJavascript(strScript)
Copy link to clipboard
Copied
What happens when you execute following code in the console of Adobe Acrobat?
this.saveAs("myDoc.jpeg", "com.adobe.acrobat.jpeg");
Copy link to clipboard
Copied
I'd expect you to need a full DIPath like /C/Folder/Subfolder/myDoc.jpeg
Copy link to clipboard
Copied
It is ok. it can save to image.
But i call it from vb.net it can't working.
I try with this code:
Dim jso = oDoc.GetJSObject
Try
jso.saveAs("myDoc.jpeg", "com.adobe.acrobat.jpeg")
Catch ex As Exception
End Try
It occur error:
NotAllowedError: Security settings do not allow access to this property or method.
Copy link to clipboard
Copied
Look at the documentation of the method saveAs.
Copy link to clipboard
Copied
i try create file [config.js;
myTrustedSaveAs = app.trustedFunction( function ( doc, oArgs )
{
app.beginPriv();
var myTrustedRetn = doc.saveAs( oArgs );
app.endPriv();
return myTrustedRetn;
});
Copy file [config.js] to folder
And run script from console:
myTrustedSaveAs(this, { cPath:"myDoc.jpeg", cConvID:"com.adobe.acrobat.jpeg" });
It show error:
ReferenceError: myTrustedSaveAs is not defined
1:Console:Exec
undefined
Copy link to clipboard
Copied
Did you restart Adobe Acrobat?
Copy link to clipboard
Copied
yes, i had close and open again.
Copy link to clipboard
Copied
sorry, close again, it had working. thank you.