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

Function ImportIcon with URL

New Here ,
Feb 15, 2016 Feb 15, 2016

Hello! I have a problem with the function ImportIcon, in order to insert a PDF into a button.

My code is the following:

  app.beginPriv();    // Explicitly raise privilege

  this.importIcon("myIcon", Path, 0);

  app.alert(Path);

  app.endPriv();

It works perfectly when I use a path from my disk, but we are trying to add PDF from a URL and then our problems begin. For example, we are trying with this URL with a PDF sample and we are not able to add it inside the button: http://www.orimi.com/pdf-test.pdf

I don't know if there is any way to escape that URL to treat it like a Path, or some function to get it.

Thanks a lot!

TOPICS
Acrobat SDK and JavaScript , Windows
732
Translate
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 ,
Feb 16, 2016 Feb 16, 2016

This method takes a DIPath. A DIPath does not take a protocol, it describes a local file.

Translate
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
New Here ,
Feb 16, 2016 Feb 16, 2016

Thanks for the answer. So there is no way to convert the URL to a Path in order to apply that PDF of the link to the icon?

If I enter in the Properties of the button, and in the window "Options", clicking "Choose Icon", if I put directly the URL Acrobat is able to download the link and put it inside the icon. I don't know how to do that with Javascript:

aa.png

Translate
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 ,
Feb 16, 2016 Feb 16, 2016

‌The UI is doing things the runtime engine will not. A DIPath cannot represent a URL.

Translate
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
New Here ,
Feb 16, 2016 Feb 16, 2016

Thanks a lot for your help and answer.

So there is no other way to load an image/pdf from a URL to embed it into a button?


Thanks!

Translate
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 ,
Feb 16, 2016 Feb 16, 2016
LATEST

I never heard of such a thing. But I admit I am surprised that you can do it in the UI.

But an important point about JavaScript is that it is a parallel environment to the UI. In many apps, scripting is a way to directly control menus and dialog options, but in Acrobat it is a different set of facilities.

Translate
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