Planet PDF Forum Archive

Planet PDF ForumWowsers! This is page is old, head to the LIVE Planet PDF Forum. It features more than 10 conferences, covering everything from beginner to in-depth developer and pre-press discussions. If you wish to continue... one & two archive covers 1999-2011 (160,000 pages).

New Forum | Previous | Next | (P-PDF) Developers

Topic: Converting Media from Word
Conf: (P-PDF) Developers, Msg: 93515
From: PeytonTodd
Date: 8/2/2003 02:38 AM

Hello. I'm a developer, but of web apps, and only just bought my first copy of Acrobat (Pro 6.0). But my problem seems complex enough I should be asking developers for help!

I am writing a linguistics research paper about a hearing child of deaf parents learing to speak. I want to provide icons which the reader can click on, and either hear an utterance (.WAV file) or see a video (.MPG file), usually showing sentences in ASL (deaf sign language). Using Insert | Object, Microsoft Word can do this fine for the audio, but their solution for the video is tacky (a “Package” instead of an icon, which acts differently from an icon, and has other undesirable properties) – and anyway, I’d rather have it as a PDF for ease of distribution.

If you create a PDF (with Acrobat 6.0 Pro) from the above Word file, all the icons (images) appear just where they should be, but NONE OF THEM WORKS.

Well, okay, once I convert the Word doc to a PDF, I can either (a) use the Movie tool and the Sound tool to re-do the media clips in Acrobat, or (b) achieve a similar result using the Link tool. Not so bad, I guess, even if I have to do it for over 200 audio or video clips in the paper I just wrote…


The problem is, WHAT HAPPENS WHEN I NEED TO MAKE CHANGES? This paper will be re-written many times, based on reviewer comments, etc. Whole paragraphs will be re-written, added, or deleted. Some media clips will be removed while others will be added, etc. But Acrobat’s editing capabilities are severely limited. There’s only the touch-up tools, which won’t even word-wrap, to say nothing of flowing the text to subsequent pages. So the revisions must evidently be done in Word, with the PDF re-created each time from there. BUT HOW CAN I AVOID HAVING TO RE-DO ALL 200 LINKS IN ACROBAT EVERY TIME I REVISE THE PAPER?

I have had better luck starting with HYPERLINKS in the Word document instead of OLE objects. But here there are still many problems. There are basically four approaches:

1. Build the hyperlinks in Word as text and convert directly to PDF. These links do convert successfully, but the result is not very attractive. I want the reader to have ICONS to click on, not text. And there appears to be no way to substitute icons for the text once they are in Acrobat. Even if there were, you’d have to do it one link at a time.

2. Build the hyperlinks in Word as icons and convert directly to PDF. These APPEAR to convert okay – for example, the hand cursor changes to a pointing finger when you mouse over them – but when you click on them you get an error message saying ‘Could not open the file’. It turns out that the reason for this is that (wierdly, only when the link is an icon but not when it is text!) the conversion process escapes all spaces as %20. This can be fixed after the fact by going into each link and re-pointing them to the media file. But again, you have to do this one link at a time (for all 200 links, and again every time the document is revised). Or, of course, you could have filenames which to do not contain spaces. But for other reasons, it is important for the filenames of my media clips to contain spaces. Note that this appears to be a bug in Acrobat, which seems to assume that just because a link is from an image it must be part of a web page and so must need escaping characters like spaces to create a web-acceptable URL.

3. Build the hyperlinks in Word as text, convert to HTML, and convert the HTML to PDF. The HTML works fine (for what it’s worth, inspecting the code, you see that spaces are escaped to %20 both for text links and for image links). However, when you convert the HTML to PDF, although the links are there (e.g., the cursor changes to a pointing finger when you mouseover), they only work under certain conditions. Results differ in Acrobat Reader vs. Acrobat itself (definitely a bug, in my opinion - but how to get past it?):

a. In Acrobat 6.0 Professional (the main app), NO links work. When you click them you get an error message saying ‘Unknown format’. Furthermore, the action specified in the Link Properties dialog is ‘Open a web link’ instead of ‘Open a file’, and this happens regardless of whether you tell Acrobat to create PDF from a file or from a web page – evidently when you say create from a file, it looks into the file and decides what kind of file it is based on finding the tag or something similar. Depending on the scenario (I’ve tested lots, and can’t remember which one this was), it sometimes tries to open it in the browser.

b. Surprisingly, in Acrobat Reader 6.0, the links DO work, but only if you don’t have a comma (or other special character?) in the filename. It turns out that the conversion process escapes spaces to %20 but does not escape commas! However, many of my filenames have commas in them. Not only is this desirable in itself for my purposes, but I have literally thousands of media files, any one of which could be used in subsequent papers I intend to write. It would be a big job to rename all the ones which have commas in them – and many have other special characters, such as the hyphen, in their names, which is also, quite probably, not escaped in your conversion process.

4. Build the hyperlinks in Word as icons, convert to HTML, and convert the HTML to PDF. Here the results are identical to what happens for text links converted to PDF via HTML, as just described in item 3.

Is there a solution to these problems? Or is there some other authoring software which might work in lieu of Word?

Another possibility, which I am reluctant to pursue unless I know it will work is Javascript. As you probably know, there is a macro language for Word (i.e., VBA) which enables a coder to prepare or revise (and even entirely write from scratch) Word documents using code… since I notice that it’s possible to write Javascript for Adobe, can that function as a macro language for PREPARING PDFs, i.e., not just for triggering actions while reading a document, but for revising it BEFORE it is published – for example, A macro to escape the characters which still need escaping in the URLs which are found in the document’s links?

Scanning through the your Javascript reference manual on the website, I’m not optimistic… There’s a getLinks function but it evidently must specify which page you want to get links on. And what could it return but properties of the Link object, among which I do not find its URL, but only trivial stuff like borderWidth. There’s a setAction method of the Link object, but I don’t see a getAction method, so how would you know what URL to escape?

Please help!

Peyton Todd

PDF In-Depth Free Product Trials Ubiquitous PDF

Debenu Aerialist

The ultimate plug-in for Adobe Acrobat. Advanced splitting, merging, stamping, bookmarking, and link...

Download free demo

Debenu PDF Tools Pro

It's simple to use and will let you preview and edit PDF files, it's a Windows application that makes...

Download free demo

Five visions of a PDF Day

In the world of PDFs or as we like to say Planet (of) PDF, a year isn't a real PDF year without an intense few days of industry knowledge sharing.

May 15, 2018
Platinum Sponsor

Search Planet PDF
more searching options...
Planet PDF Newsletter
Most Popular Articles
Featured Product

Debenu PDF Aerialist

The ultimate plug-in for Adobe Acrobat. Advanced splitting, merging, stamping, bookmarking, and link control. Take Acrobat to the next level.


Adding a PDF Stamp Comment

OK, so you want to stamp your document. Maybe you need to give reviewers some advice about the document's status or sensitivity. This tip from author Ted Padova demonstrates how to add stamps with the Stamp Tool along with related comments.