On Jul 7, 2009, at 4:19 PM, Landy Atkinson wrote:
I created a database to hold some one page PDF files that are the
output from a mechanical drawing program. I defined a container
field to hold the PDF and then used the Import Records script step
to pull in a folder of PDFs. During the import, I unchecked the box
"Import only a reference..." and so expected the PDFs to become part
of the database. Instead, I seem to be getting only references. If
the file computer with the shared folder of PDF drawings is not
connected, the container field gives the message "The file cannot be
found." If I reconnect to the folder of PDF images, then all is
well again.
Is this the expected behavior for PDF files? Anyway to actually
pull copies of the PDF documents into the database
I'm assuming you're on a Mac. When you use the "Import Folder" script
step like this, PDF files are brought in as QuickTime movie documents.
"Movies" are never stored in the database - they are always stored by
reference.
What you can do, however, is post-process these "Movies" and reinsert
them as "Pictures." If you use the "GetAsText()" function on your
container field you will note it has a size, a (sorta) relative path,
and platform-specific full path. It is this third path we can exploit
to convert the movies to images. The following script snippet will
convert a found set of movies stored as relative links into images
stored in the file.
Go to Record/Request/Page [ First ]
Loop
Set Variable [ $path; Value:GetValue ( GetAsText
( yourTable::yourField ); 3 ) ]
Set Variable [ $path; Value:Replace ( $path; 1; 5; "image" ) ]
If [ not IsEmpty ( $path ) ]
Go to Field [ yourTable::yourField ]
Insert Picture [ "$path" ]
End If
Go to Record/Request/Page [ Next; Exit after last ]
End Loop
Cheers,
-corn
Corn Walker
The Proof Group
http://proofgroup.com/