Convert Table to Image?

I have around a dozen tables that I would like to convert to images in Pages.


How do I do this? It's apparently not as simple as right-clicking and 'convert to image' 😝


Thanks, guys.

Pages-OTHER, Mac OS X (10.6.7)

Posted on May 10, 2011 3:18 PM

Reply
14 replies

May 10, 2011 6:12 PM in response to malcmcmul

Here are a couple of methods:


1. Take a screen shot. Press shift-command-4, then drag the crosshair cursor to select the portion of the screen you want to capture. When you release the mouse button, the selected area will be captured and saved to your desktop as a .png file (Picture 1.png).


2. Select the table and Copy. Launch Preview and go File > New from Clipboard. Save the image in whichever format you desire.


Insert or paste the image file into Pages.


Regards,

Barry

May 10, 2011 9:58 PM in response to Badunit

Badunit wrote:


It was the first thing I tried. I expected it to work like it does in Numbers.

And therin lies a possible solution!


Select the table in Pages.

Copy.

Open a Numbers document.

Click in the Sheets list, then Paste.

Select the Table in Numbers.

Copy.

Open Preview and press command-N (or go File > New from Clipboard.

Save the result in the format of your choice.


Here's the result, using PNG as the format (Click to expand):

User uploaded file

The original is a table from the Pages "business report" template, copied with the placeholder text still in it.


Regards,

Barry

May 10, 2011 11:53 PM in response to Badunit

Badunit wrote:


It was the first thing I tried. I expected it to work like it does in Numbers.

Badunit,


Of course it should work as it does in Numbers. I'll volunteer to also report the bug.


There is a method that doesn't require Numbers and works almost as smoothly as Copy, Open Preview, Command-N. That is:


In Pages, Command-P, select just the current Page to Print, PDF: Open in Preview, Rectangular Selection of Table, Command-C, Command-N.


Jerry

Feb 26, 2012 8:37 AM in response to nobx

Here is a script doing the trick in a single call.


--{code}

--[SCRIPT table-from-Pages-to-PDF]

(*

Enregistrer le script en tant que Script : table-from-Pages-to-PDF.scpt

déplacer le fichier ainsi créé dans le dossier

<VolumeDeDémarrage>:Utilisateurs:<votreCompte>:Bibliothèque:Scripts:Applications :Pages:

Il vous faudra peut-être créer le dossier Pages et peut-être même le dossier Applications.


Sélectionner une table dans Pages

Aller au menu Scripts , choisir Pages puis choisir “table-from-Pages-to-PDF”

Le script copie la table, la colle dans un document Numbers temporaire.

Il copie la table devenue objet Numbers puis demande à Aperçu de créer un nouveau document depuis le presse-papiers


Bien entendu il est possible d'utiliser FastScripts pour associer un raccourci clavier au script.


--=====


L’aide du Finder explique:

L’Utilitaire AppleScript permet d’activer le Menu des scripts :

Ouvrez l’Utilitaire AppleScript situé dans le dossier Applications/AppleScript.

Cochez la case “Afficher le menu des scripts dans la barre de menus”.

Sous 10.6.x,

aller dans le panneau “Général” du dialogue Préférences de l’Éditeur Applescript

puis cocher la case “Afficher le menu des scripts dans la barre des menus”.


--=====


Save the script as a Script: table-from-Pages-to-PDF.scpt


Move the newly created file into the folder:

<startup Volume>:Users:<yourAccount>:Library:Scripts:Applications:Pages:

Maybe you would have to create the folder Pages and even the folder Applications by yourself.


Select a Pages table.

Go to the Scripts Menu, choose Numbers, then choose “table-from-Pages-to-PDF”

The script copy the table, paste it in a temporary Numbers document.

Then it copy the table which is now a Numbers object and close the temporary document.

At last, it ask Preview to create a new document from the clipboard.


--=====


The Finder’s Help explains:

To make the Script menu appear:

Open the AppleScript utility located in Applications/AppleScript.

Select the “Show Script Menu in menu bar” checkbox.

Under 10.6.x,

go to the General panel of AppleScript Editor’s Preferences dialog box

and check the “Show Script menu in menu bar” option.


--=====


Yvan KOENIG (VALLAURIS, France)

2012/02/26

*)

--=====


on run

my activateGUIscripting()


tell application "Pages"

--

end tell


(*

Copy the Pages table *)

my raccourci("Pages", "c", "c")


set myNewDoc to my makeAnIworkDoc("Numbers")

tell application "Numbers" to tell document myNewDoc to tell sheet 1


deletetable 1

end tell


(*

Paste it in a temporary Numbers document *)

my raccourci("Numbers", "v", "c")

delay 0.1


(*

Copy the table which is now a Numbers object *)

my raccourci("Numbers", "c", "c")


(*

Close the temporary document *)

tell application "Numbers" to close document myNewDoc without saving


(*

Create a new Preview document from the clipboard *)

my raccourci("Preview", "n", "c")

end run


--=====

(*

Creates a new iWork document from the Blank template and returns its name.

example:

set myNewDoc to my makeAnIworkDoc(theApp)

*)

on makeAnIworkDoc(the_App)

local maybe, path_to_the_App, nb_doc

if the_App is "Pages" then

tell application "Pages"

set nb_doc to count of documents


makenewdocumentwith properties {template name:item 1 of templates}

end tell

else if the_App is "Numbers" then

tell application "System Events" to the_App is in title of every application process

if not result then activateapplicationtheApp

tell application "System Events"

set path_to_the_App to get application file of application processthe_App

end tell

tell application "Numbers"

set nb_doc to count of documents

open ((path_to_the_App as text) & "Contents:Resources:Templates:Blank.nmbtemplate:")

end tell

else

if my parleAnglais(theApp) then

error "The application “" & the_App & "“ is not accepted !"

else

error "l’application « " & the_App & " » n’est pas gérée !"

end if

end if


tell applicationthe_App

repeat until (count of documents) > nb_doc

delay 0.1

end repeat

name of document 1

end tell -- the_App

return result

end makeAnIworkDoc


--=====


on activateGUIscripting()


(* to be sure than GUI scripting will be active *)

tell application "System Events"

if not (UI elements enabled) then set (UI elements enabled) to true

end tell

end activateGUIscripting


--=====

(*

==== Uses GUIscripting ====

*)

(*

This handler may be used to 'type' text, invisible characters if the third parameter is an empty string.

It may be used to 'type' keyboard raccourcis if the third parameter describe the required modifier keys.


I changed its name « shortcut » to « raccourci » to get rid of a name conflict in Smile.

*)

on raccourci(a, t, d)

local k


activateapplicationa

tell application "System Events" to tell application process a

set frontmost to true

try

t * 1

if d is "" then


key codet

else if d is "c" then


key codetusing {command down}

else if d is "a" then


key codetusing {option down}

else if d is "k" then


key codetusing {control down}

else if d is "s" then


key codetusing {shift down}

else if d is in {"ac", "ca"} then


key codetusing {command down, option down}

else if d is in {"as", "sa"} then


key codetusing {shift down, option down}

else if d is in {"sc", "cs"} then


key codetusing {command down, shift down}

else if d is in {"kc", "ck"} then


key codetusing {command down, control down}

else if d is in {"ks", "sk"} then


key codetusing {shift down, control down}

else if (d contains "c") and (d contains "s") and d contains "k" then


key codetusing {command down, shift down, control down}

else if (d contains "c") and (d contains "s") and d contains "a" then


key codetusing {command down, shift down, option down}

end if

on error

repeat with k in t

if d is "" then


keystroke (k as text)

else if d is "c" then


keystroke (k as text) using {command down}

else if d is "a" then


keystrokekusing {option down}

else if d is "k" then


keystroke (k as text) using {control down}

else if d is "s" then


keystrokekusing {shift down}

else if d is in {"ac", "ca"} then


keystroke (k as text) using {command down, option down}

else if d is in {"as", "sa"} then


keystroke (k as text) using {shift down, option down}

else if d is in {"sc", "cs"} then


keystroke (k as text) using {command down, shift down}

else if d is in {"kc", "ck"} then


keystroke (k as text) using {command down, control down}

else if d is in {"ks", "sk"} then


keystroke (k as text) using {shift down, control down}

else if (d contains "c") and (d contains "s") and d contains "k" then


keystroke (k as text) using {command down, shift down, control down}

else if (d contains "c") and (d contains "s") and d contains "a" then


keystroke (k as text) using {command down, shift down, option down}

end if

end repeat

end try

end tell

end raccourci


--=====

--[/SCRIPT]

--{code}


Before writing it, I made several tests.


set the clipboard to the clipboard as «class PDF »

With it, Preview create a white rectangle

set the clipboard to the clipoard as «class 8BPS»

which is the PhotoShop format

With it, Preview create a gray rectangle

set the clipboard to the clipoard as «class RTF »

Preview can't treat this contents

set the clipboard to the clipoard as «class rtfd»

Preview can't treat this contents

set the clipboard to the clipoard as «class TPIC»

Preview create a white rectangle.


Each time, the result is the same if we select the table (with its 8 handles)

or if we select every cells.


Using a temporary Numbers document was the easiest workflow for a script.


Yvan KOENIG (VALLAURIS, France) dimanche 26 février 2012

iMac 21”5, i7, 2.8 GHz, 12 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.3

My Box account is : http://www.box.com/s/00qnssoyeq2xvc22ra4k

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Convert Table to Image?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.