• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How can export a page to image?

Enthusiast ,
Apr 23, 2019 Apr 23, 2019

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.

pdf.png

TOPICS
Acrobat SDK and JavaScript

Views

3.5K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Apr 23, 2019 Apr 23, 2019

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.

Votes

Translate

Translate
Community Expert ,
Apr 23, 2019 Apr 23, 2019

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Apr 23, 2019 Apr 23, 2019

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)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 23, 2019 Apr 23, 2019

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");

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 24, 2019 Apr 24, 2019

Copy link to clipboard

Copied

I'd expect you to need a full DIPath like /C/Folder/Subfolder/myDoc.jpeg

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Apr 24, 2019 Apr 24, 2019

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 24, 2019 Apr 24, 2019

Copy link to clipboard

Copied

Look at the documentation of the method saveAs.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Apr 24, 2019 Apr 24, 2019

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 24, 2019 Apr 24, 2019

Copy link to clipboard

Copied

Did you restart Adobe Acrobat?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Apr 24, 2019 Apr 24, 2019

Copy link to clipboard

Copied

yes, i had close and open again.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Apr 24, 2019 Apr 24, 2019

Copy link to clipboard

Copied

LATEST

sorry, close again, it had working. thank you.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines