Insert pdf into a Portfolio via Javascript
Hi,
I'm hoping someone can help me, as I am struggling to find an answer for this. Admittedly, I am new to Acrobat JS. I've checked the Adobe Javascript API, and I can't seem to find out how to do it. The only collection methods all relate to fields, and the properties are fields, initialDoc and initialview. I can't seem to see how to add a doc at all.
In my searches, I did find this utility: New Feature added to Joel’s PDF Portfolio Utilities: Version 1.7 – The PDF Developer Junkie Blog
He does provide an interesting function in javascript: "Combine all open PDF portfolio's"
Checking the source code on that I see the following:
function ADBE_JFG_CombineCollections()
//get an array of all of the open documents
var docs = trustedActiveDocs();
if (docs.length > 0)
//Create a new empty portfolio
newPortfolio = trustedNewCollection();
//create a thermometer
t = app.thermometer;
t.duration = docs.length;
t.begin();
i=0
//loop through each open document
for each (doc in docs)
t.value = i
//if the document is a Portfolio... (we won't add single PDFs)
if (doc.collection)
//first add all the fields that we need
for each (f in doc.collection.fields)
try
newPortfolio.collection.addField({name:f.name, text:f.text, type:f.type});
console.println("Field named "+f.name+" added");
catch (err)
console.println("Field named "+f.name+" already present.");
for each (item in doc.dataObjects)
t.text = "Inserting file "+item.name;
newPortfolio.createDataObject(item.name, "");
newPortfolio.setDataObjectContents(item.name, doc.getDataObjectContents(item.name));
for each (f in doc.collection.fields)
newPortfolio.getDataObject(item.name).setFieldValue(f.name, item.getFieldValue(f.name));
t.end()
The problem is, his code will only work on portfolio's that exist already. I tried to modify it as a test to see if I could cobble something together to fit my needs and did the following:
function portTest()
var docs = trustedActiveDocs();
newPortfolio = trustedNewCollection();
//loop through all open docs
if (docs.length > 0 )
t = app.thermometer
t.duration = docs.length;
t.begin();
i=0
for each (doc in docs)
t.value = i
t.text = "Inserting file "+doc.documentFileName;
newPortfolio.createDataObject(doc.documentFileName, "");
newPortfolio.setDataObjectContents(doc.documentFileName, doc.getDataObjectContents(doc.documentFileName));
t.end();
This was unsuccessful, causing adobe to raise an internal error if attempted as a script, and the debugger gives me an error as well. If I comment out this line:
newPortfolio.setDataObjectContents(doc.documentFileName, doc.getDataObjectContents(doc.documentFileName));
The script runs, creating a new portfolio, and inserting an entry for a new doc, but that entry has no contents. As far as the API seems to document, getDataObjectContents() seems to be used to read external files (which I assume Acrobat treats docs in a portfolio/collection as an attachment and that's why Joel's code works? I am unclear on this though). At this point, I am lost... how can I get the doc(s) I want to be inserted into a portfolio? I thought it would be a lot easier than what this has turned out to be, and unfortunately there isn't a plethora of resources on the subject. Sorry, I've been working on this for four days, and keep spinning my wheels. Thank you in advance for any help or pointers you could offer.
You probably are too new to ObjectOrientated languages and JavaScript.
The sample code you provided does not include the other functions that Joel is using to populate an an array variable whose elements or cells contain the object name for the opened PDF files.
The line of code:
var docs = trustedActiveDocs();
Calls the "trustedActiceDocs" function. This function uses Acrobat's app.activeDoc object array to populate the "docs" variable.
And there are even more supporting functions that Joel has declared as part of the entire script file.
Similar Messages
-
Firefox 4.0 support for printing embedded PDF files in iFrames via JavaScript
I recently upgraded to Firefox 4.0 and can no longer print embedded PDF documents contained in an iFrame.
My company's web application has several pages which load PDF files from a Servlet into an iFrame. The pages in question all have "Print" buttons which when clicked executes a JavaScript function to obtain reference to the iframe containing the PDF, place it into focus() (e.g., frames['pdfdoc'].focus();), and invoke print() (e.g., frames['pdfdoc'].print();). There are no errors, or exceptions caught when the JavaScript function is invoked, but the "Print" button is no longer operational.
Does Firefox 4.0 no longer support iFrames? The issue goes away if I revert back to ver 3.6.16I have same issue for printing embedded PDF files in iFrames via JavaScript in Firefox 5.0.
In previous versions it was working fine. But not in Firefox 4.0/5.0.
Is there any solution for this problem? -
Inserting PDFs into existing PDFs using Preview
Previous to the 10.6.6 update I was able to insert a PDF document into an existing PDF document by dragging the new PDF into the sidebar within Preview.
Now when I try this, instead of adding the document, it opens the PDF I have just dragged in, in the same window.
Is this a setting that I have missed somewhere? Have check document security permissions, preferences etc...
Thanks
Message was edited by: griffsPreview (in Snow Leopard) can display more than one multi-page PDF in one window. If you drag pages from document 2 into the space at the end of the sidebar of document 1, they will remain as separate documents. Drag them on top of the pages of document 1 in the sidebar. Document 1 will highlight and you can position the pages as desired. It is easier to do it than to explain it.
-
Hey,
I was just wondering whether is was possible to insert PDF's into a Pages document. In my case I have a Project document and I want to include weekly reports which are stored as PDF's.
If I do: Insert > Choose > ...(*) I only seem to be inserting the first page of the PDF
It might be that it's not possible, but it wouldn't seem an unreasonable feature for Pages.
*(may be called slightly different, im using a Dutch language version of Pages '09)It allow us to select a rectangular area like the one which is drawn in my late screenshot.
Here you may see the menu "Tools" which offer the menu items whose shortcuts are cmd 1, cmd 2, cmd 3.
As I already wrote, cmd 3 allow us to select a rectangular area.
If you trigger cmd 2 you may trigger text as you may see below.
At least on my machine, Preview defaults to the mode activated by cmd 2.
Yvan KOENIG (VALLAURIS, France) lundi 6 juin 2011 10:39:40
iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.7
Please : Search for questions similar to your own before submitting them to the community
To be the AW6 successor, iWork MUST integrate a TRUE DB, not a list organizer ! -
Inserting data into Ms Access via jdbc odbc connectivity
Can anyone help dictate what's wrong with this below method which is supposed to be adding new record(append) into my ms Access Table. This is giving me a hell of problem, I thought I have everything well. The module is branched via a Swing ui. Can you debug this ? and send a new code to try?
public void Query3(){
try{
//while(rs.next() )
stmt.executeUpdate("INSERT INTO pupRegister_Table1 " +
"VALUES ('1001', 'Simpson', 'Mr.', 'Springfield', '2001')");
//stmt.executeUpdate ("INSERT INTO pupRegister_Table1 " +
//"VALUES(var_firstname)");
// Close the result set, statement and the connection
rs.close() ;
stmt.close() ;
conn.close() ;
} catch( SQLException se )
System.out.println( "SQL Exception:" ) ;
Thanks. Note I have done all the DriverManager stuff already and other modules like for displaying the records, do work fine.Thanks a lot,
that contribution really helped but I realised that I Missed adding the
insertRow();
that did the trick and it works fine now
Thanks
Yet another issue is about inserting the current date into the date field having data type as date. Hence I am using the Jdbc stuff. I am having problem here
any further help? -
Insert PDFs into Power Point with Adobe Reader 10 doesn't work
Hello,
When I try to insert a PDF Document into a Power Point Sheet (Microsoft Office 2003) the following an error occurred: "Die Serveranwendung , die Quelldatei oder das Element konnte nicht gefunden werden oder ein unbekannter Fehler wurde zurückgemeldet. Installieren Sie die Serveranwendung unter Umständen erneut." In English it would be somethink like: "Die Serverapplikation, the sourcefile or the element could not be found or an unknown error get recalled. According to the circumstances install the serverapplication again."
The error appears when I click in Power Point on "Insert" then on "Object" and then on "OK" if the Adobe Acrobat Document is selected. The error occurred since I use Adobe Reader X on Windows XP and on Windows 7.
Have anyone any idea, or know a solution?
Greetings from CologneHallo Andreas,
hier wie versprochen die Keys um den Geschützen Modus per Gruppenrichtlinie zu de/aktiveren.
Der Key für Geschützer Modus wenn er aktiviert ist lautet:
[HKEY_CURRENT_USER\Software\Adobe\Acrobat Reader\10.0\Privileged]
"bProtectedMode"=dword:00000001
Und demensprechend lautet der Key für den deaktiverten "Protected Mode":
[HKEY_CURRENT_USER\Software\Adobe\Acrobat Reader\10.0\Privileged]
"bProtectedMode"=dword:00000000
Hallo Werner,
wir benutzen hier Windows 7 x64, sowie Windows XP x86. Allerdings haben wir bei beiden Systemen keine Probleme wenn wir den Geschützen Modus deaktiveren.
Kannst du mir vielleicht noch die nachfolgenden 3 Fragen beantworten, damit ich ein bessere Vorstellung vom Problem habe?
Welches MS Office (bzw. PP) nutzt ihr?
Über welchen Weg bzw. über welche Funktion wollt ihr das PDF in PP implmentieren/einbetten?
Wie genau lautet der Text der Fehlermeldung?
Grüße aus dem verregneten Köln
Eike -
Hi there,
I would like to import or insert a pdf file (acrobat) into an
html document
and be able to write above and below the document. I have
copied the document
into MS paint and saved it as a gif file and inserted it that
way...Is there any more
direct way to do this? I have not been able to copy and paste
directly into DW from
adobe acrobat....Please advise!!
Thanks abunch!
RCcrash wrote:
> Adobe Acrobat is a plugin, and as such it requires the
plug-in to view. You
> cannot "mix" a pdf and HTML AFAIK. The PDF must be view
in the PDF
> application.
>
> You can, of course, convert your PDF to any image format
and place it within
> your content as you've done.
>
> You might try using frames, but I don't know how
successful that would be
> (sounds a bit nightmarish to me).
>
> HTH,
>
> Jon
>
> "rcshell" <[email protected]> wrote in
message
> news:e48u6r$nmi$[email protected]..
>> Hi there,
>> I would like to import or insert a pdf file
(acrobat) into an html
>> document
>> and be able to write above and below the document. I
have copied the
>> document
>> into MS paint and saved it as a gif file and
inserted it that way...Is
>> there
>> any more
>> direct way to do this? I have not been able to copy
and paste directly
>> into
>> DW from
>> adobe acrobat....Please advise!!
>> Thanks abunch!
>> RC
>>
>
>
Or you could convert the pdf to FlashPaper, then insert as
you would an
image. You choose the size. -
How to get best image quality when inserting PDF into Word?
I am able to insert a PDF as an object into Word, but the image quality is slightly blurry. Is there anything I can adjust to improve image clarity in Word?
You can try to extract the images using Extract All Images or select the Settings on the save screen that you get when you save to a DOC, but I think the general result is that the image saves with the same resolution as contained in the PDF. It may be that you need to just adjust your screen in WORD. You might want to look at the image in WORD and see if it is being used at 100% or some other resolution. Bitmaps are not very forgiving if the resolution is changed for the document and does not like anything other than low number fractions of resolution display change.
-
Insert row into database table via dynamic form -
I have developed a portlet via Portal. I used a dynamic page. I replaced the default "<ORACLE>select * from scott.emp</ORACLE>" text to call a package procedure that uses HTP.P to render the web page. My goal is to show all rows in a table and allow edits to any row, and also add a checkbox on each row to allow the user to mark for delete. I am successfully using a FOR loop and showing all of the data in a grid. My problem - How do I update and delete the data? I have a submit button with nothing behind it currently. I would ideally like to use pl/sql code to do the updates and/or deletes as marked on the page by the user, but I'm not sure how to hook the submit button to calling a procedure to execute the updates/deletes.
Any help would be appreciated -
Thanks -
KentHi Patrick - Thanks for your response! I have browsed your page quickly - very informative and I will look in more detail. My form design looks as below (using a simple example with emp id and emp name columns) - perhaps this will have to change, but I wanted the user to be able to insert using html fields id_add and name_add, then update (or mark for deletion) any of the existing rows (they are rendered with for loop in pl/sql - eg, id_1/name_1, id_2/name_2, etc for each row in the table). I was hoping the submit action would call a pl/sql that would look at all rows, and then act if an update or delete were required. This makes it difficult to use parms, I believe - I may be able to change the design to show an "update row" below the current "insert row" so that, as in your example, when the user highlights a row, it populates in the update area where changes can be made, and an update button used to effect the changes to a single row at a time.
Thanks again, I appreciate your input!
Kent
______________ _________________ <insert_button>
Emp Id (textbox) Emp Name (textbox) Del_Checkbox
______________ _________________ ___ <SUBMIT_BUTTON>
------------------------- ----------------------------- ------ -
To All,
I recently purchased a brand new Dell Laptop Inspiron 5521 Windows 7 Home Premium with purchase of Microsoft Office 2013 and already preinstalled Adobe Reader X. When trying to insert object being a saved pdf documentinto Word Doc., I keep receiving the following message: [There was an error opening this document. This file cannot be found.] Why?I don't know but I wouldn't expect it to work anyway. What do you expect to happen?
-
Insert PDF into new Adobe Form - merging two PDF files into one
Hi everyone,
I need to enable access to archive PDF files but within a new PDF file containing header and footer.
Request is not to change archived PDF files at all.
I use Web Dynpro application to upload PDF file and to display new PDF file.
I thought converting archive PDF files into JPG files and than using an 'Image Field' object to display those in a new PDF file.
I am dealing here with PDF version 1.3 files.
I am also having trouble converting these PDF files into JPG files. Any sugestions one this problem?
Does anyone have any suggestion on how to deal with this concerning the fact that archive PDF files can not be changed?
Is there some other way to merge two PDF files into one using Adobe Designer?
Regards,
AmelHello, Lukasz:
I am also facing similar requirement from my customer.
And I found one useful blog, hope this blog can help you.
http://wiki.sdn.sap.com/wiki/display/WDJava/CombinePDFfileswithWebDynproforJava
Best regards, Nick. -
Employees create a pdf file from data, they complete a QA form that I've created about this data. Is it possible to insert/attach this pdf file to the form?
What would be the best way?
CheersThanks Jasmin thats what we will do.
Just a follow on from this. Is there a way to create say a text field and the user of the form can "paste" a text in there which will expand to allow for the amount of lines pasted.
I will do some testing myself and see how I go
Thanks for all the help
Daniel -
Promlem with loading QT content in Safari into a div via innerHTML
Hello,
I have created a website where I'm loading QT content into a div via Javascript by using InnerHTML. I'm generating the Object/embed with javascript. Take a look at the following javascript function:
//This function generates object/embed tags on the page
//each time a movie thumbnail is clicked
function showMovie(folder, previewUrl, movieUrl)
var content = new getObj('content');
var movieObj = new getObj('contentMovie');
if(BrowserDetect.browser == 'Safari')
//I added this bit becaus Safari kept on playing the previous movie
movieObj.obj.Stop();
content.obj.innerHTML = '';
var urlStart = "[(base_url)]" + folder + "/";
var qtUrl = movieUrl.split('../')[1];
qtUrl = urlStart + qtUrl;
var myQTObject = new QTObject(previewUrl.split('.')[0] + ".gif", "contentMovie", "489", "280");
myQTObject.altTxt = "Upgrade your Quicktime Player!";
myQTObject.addParam("name", "contentMovie");
myQTObject.addParam("href", movieUrl);
myQTObject.addParam("controller", "true");
myQTObject.addParam("scale", "tofit");
myQTObject.addParam("target", "myself");
myQTObject.addParam("autoplay", "true");
myQTObject.addParam("saveembedtags", "true");
myQTObject.addParam("enablejavasript", "true");
content.obj.innerHTML = myQTObject.getHTML();
As you can see I'm specifically checking to see if the browser is Safari, then I'm stopping the movie via javascript. It seems that Safari keeps all the movies in memory and somhow loads them on top of each other instead of disposing of them when the innerHTML is set to an empty string... this took care of one problem which was preventing Safari from playing multiple movies at once(somehow stacking on top of each other). However, the fastStart movies keep loading in the background so you could argue that Safari is leaking memory and loading movies in the background that should not be there.
Does anyone have a clue on how to fix this? Wouldn't you define this as a bug? I took a look at the QT javascript API and it seems to me that there is no command that tells the movie to stop loading or howto dispose of it. Maybe I can swap the movie URL via javascript if the browser is Safari, but I'd like to know if there is another way since I'm using a poster movie and I imagine it will complicate things. Anyway, you can test for your self on www.koggull.com/index.php, if you don't understand the problem. I suggest that you keep Activity Monitor open, then you can see how Safari eats up memory when browsing my website. All help would be greatly appreciated.
MacBookPro Core2 duo 2.33 Ghz Mac OS X (10.4.8)FYI I posted a similar question in one of the Quicktime forums. I haven't gotten any answers: http://discussions.apple.com/thread.jspa?threadID=764296&tstart=0
-
Inserting pages into a multiple pdf documents in a few steps.
Dear All,
Is there a way to insert pages from what pdf into another in a few simple steps? I know how to manually insert a page into a document (have to pdfs open and drag and drop) but if you have 500 pdf documents you need to insert into 500 pdfs, it becomes a tedious process. I was wondering if there is anyway to do that in one step? I know you can password protect multiple docs in one step so I am sure acrobat has this functionality but I just don't know about it. Thank you in advance for your help!Since there's only one one-page generic document to be added after each PDF file, I think you can just use the basic features of the Action Wizard without using JavaScript. I just did a quick test.
Here are two tutorials on using the Action Wizard:
How to work with Actions
How to create and share Actions -
I`d like to know how can i insert documents, xls/doc/pdf into iCloud and have them in my iPhone and my iPad. I just found one way, through ibooks, but i think it isn't a practical option.
Just use Drop Box instead.
Maybe you are looking for
-
Some users not seeing all of a web form in Smart View Excel 11.1.2?
I am on Planning 11.1.2 and I have an end user who, when he opens a web form in Excel using Smart View, he only sees about 1/3 of the entire form. If in the Oracle/Planning web, the form is fine. When he uses my machine, he sees the entire web form i
-
Can't install XP version of Creative Recor
I recently upgraded to Windows XP (clean install SP2) and installed the drivers and programs that I received on a cd when I purchased my sound card. I then updated the drivers on Creative.com so they would work with XP (Li'veDrvUni-Pack(ENG).exe, Li'
-
Re: Need Help! Dell poweredge T630 cannot reboot after trying to add new memory
It fail to initialize the iDRAC
-
Retreiving data corresponding to dropdown list.
hii all, i want to know that if i have to make one application where there is a dropdown list with several parameters and if i select one parameter and retrieve the data corresponding to that parameter, then i select second parameter and retreive the
-
My phone is full of music and I do not have enough space to take the update. I have the photos and music on the cloud. What steps do i need to take to free up space on my phone so I can take the update?