Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

select text based on format (free form style text)

As suggested by Apple, I'm trying to create my first ePub using Pages as opposed to inDesign.

I only have a PDF as a source file and don't want to re-type all the text.

When I copy the text from the PDF and paste to Pages, the text comes in with the 'free form' style applied no matter what options I select during copy and paste.

In order to produce an ePub, I need to set styles for the text. This is quite tedious.


Is there any way to select text based on the way it is formatted when styles are not applied to the text?

Pages-OTHER, Mac OS X (10.7.2)

Posted on Dec 31, 2011 4:54 PM

Reply
12 replies

Dec 31, 2011 6:44 PM in response to jamy.s

It sounds like you are using Paste and Match style on text that is styled Freeform. Try formatting the text in the insertion location in Pages to what you want eg Body.


Freeform is a style in itself. You can change that to what you want in the Styles Drawer.


Also you can force a style onto selected text by double clicking on the Style name in the Styles Drawer.


Peter

Dec 31, 2011 6:56 PM in response to PeterBreis0807

Thanks but I've tried all the copy and paste options in both Acrobat and Pages.

I've also tried creating styles based on what was imported to no avail.


I've been applying styles successfully, just finding it tedious given the nature of my ePub.

If a could select text based on it's current free form character font, that would really speed up the process.


Nearly finished now, just thought there might be a quicker solution for next time.

Dec 31, 2011 8:57 PM in response to jamy.s

Famous last words "I've tried everything", (except what you haven't tried).


Why are you using Acrobat instead of Preview?


What happens when you export text from Acrobat Pro to Word then open that in Pages?


I've just done a test.


I have opened a pdf book in Preview selected styled text and:


1. Simply pasted it into Pages. As expected it retains the original fonts and properties.


2. I set the text to Body and did a Paste and Match Style predictably all the text pasted becomes Body style.


I next opened the pdf book in Acrobat Pro


3. Simply copy/pasted text into Pages. It sort of gets the text right, serif is serif and sans serif is sans serif but all serif is Times and and all sans serif is Helvetica. Both wrong. It also gets sizes and font styling wrong as well as adding line endings where they shouldn't be any.


4. I used the Text Editing Tool in Acrobat and it loses all styling and becomes raw text so adopts the target style in Pages.


5. I exported the pdf book to Word .docx file from Acrobat Pro which was painfully slow. I then opened the .docx in Pages. I got a warning that character scaling is not supported and was removed, but it came though amazingly close to the original pdf book only all text was in the Style "Normal" even though the actual properties varied as in the original.


Peter

Dec 31, 2011 9:56 PM in response to PeterBreis0807

Famous last words "I've tried everything", (except what you haven't tried).

Yes, agreed except I only said that I had tried the copy and paste options in Acrobat and Pages.


If I had tried everything I wouldn't bother asking for help.


I'll try preview and see how I go.


The trouble is that I don't want to capture all the text in the PDF. As I said, I'm creating an ePub so I obvoiusly don't want the TOC, header and footer text.


I am currently using your option 3 as I stated in my original email but because of the nature of my ePub, that is quite tedious.


My quesiton actually was: Is there any way to select text based on the way it is formatted when styles are not applied to the text?


That would solve my issue.


Can I take it that your opinion is that no, Pages cannot do that?



PeterBreis0807 wrote:


Famous last words "I've tried everything", (except what you haven't tried).


Why are you using Acrobat instead of Preview?


What happens when you export text from Acrobat Pro to Word then open that in Pages?


I've just done a test.


I have opened a pdf book in Preview selected styled text and:


1. Simply pasted it into Pages. As expected it retains the original fonts and properties.


2. I set the text to Body and did a Paste and Match Style predictably all the text pasted becomes Body style.


I next opened the pdf book in Acrobat Pro


3. Simply copy/pasted text into Pages. It sort of gets the text right, serif is serif and sans serif is sans serif but all serif is Times and and all sans serif is Helvetica. Both wrong. It also gets sizes and font styling wrong as well as adding line endings where they shouldn't be any.


4. I used the Text Editing Tool in Acrobat and it loses all styling and becomes raw text so adopts the target style in Pages.


5. I exported the pdf book to Word .docx file from Acrobat Pro which was painfully slow. I then opened the .docx in Pages. I got a warning that character scaling is not supported and was removed, but it came though amazingly close to the original pdf book only all text was in the Style "Normal" even though the actual properties varied as in the original.


Peter

PeterBreis0807 wrote:


Famous last words "I've tried everything", (except what you haven't tried).


Why are you using Acrobat instead of Preview?


What happens when you export text from Acrobat Pro to Word then open that in Pages?


I've just done a test.


I have opened a pdf book in Preview selected styled text and:


1. Simply pasted it into Pages. As expected it retains the original fonts and properties.


2. I set the text to Body and did a Paste and Match Style predictably all the text pasted becomes Body style.


I next opened the pdf book in Acrobat Pro


3. Simply copy/pasted text into Pages. It sort of gets the text right, serif is serif and sans serif is sans serif but all serif is Times and and all sans serif is Helvetica. Both wrong. It also gets sizes and font styling wrong as well as adding line endings where they shouldn't be any.


4. I used the Text Editing Tool in Acrobat and it loses all styling and becomes raw text so adopts the target style in Pages.


5. I exported the pdf book to Word .docx file from Acrobat Pro which was painfully slow. I then opened the .docx in Pages. I got a warning that character scaling is not supported and was removed, but it came though amazingly close to the original pdf book only all text was in the Style "Normal" even though the actual properties varied as in the original.


Peter

PeterBreis0807 wrote:


Famous last words "I've tried everything", (except what you haven't tried).


Why are you using Acrobat instead of Preview?


What happens when you export text from Acrobat Pro to Word then open that in Pages?


I've just done a test.


I have opened a pdf book in Preview selected styled text and:


1. Simply pasted it into Pages. As expected it retains the original fonts and properties.


2. I set the text to Body and did a Paste and Match Style predictably all the text pasted becomes Body style.


I next opened the pdf book in Acrobat Pro


3. Simply copy/pasted text into Pages. It sort of gets the text right, serif is serif and sans serif is sans serif but all serif is Times and and all sans serif is Helvetica. Both wrong. It also gets sizes and font styling wrong as well as adding line endings where they shouldn't be any.


4. I used the Text Editing Tool in Acrobat and it loses all styling and becomes raw text so adopts the target style in Pages.


5. I exported the pdf book to Word .docx file from Acrobat Pro which was painfully slow. I then opened the .docx in Pages. I got a warning that character scaling is not supported and was removed, but it came though amazingly close to the original pdf book only all text was in the Style "Normal" even though the actual properties varied as in the original.


Peter

Dec 31, 2011 10:21 PM in response to jamy.s

Did I say that? Did I say that? Did I say that? 😀


Pages lets you find all instances of a named style but not unnamed text with certain formatting.


It is actually impressive what Preview can do with pdfs, and Acrobat to a lesser degree, pdfs were not meant to be recycled.


If you want to select a range of text in Preview it is actually very fast.


Preview > Menu > view > PDF Display > Single Page Continuous


Click at the beginning of the text you want, hold down the shift key, then scroll down the Sidebar thumbnails to the end of what you want and click again, Copy and Paste.


Peter

Jan 2, 2012 3:26 AM in response to jamy.s

Here is a script which may be useful if your problem surface again.


--{code}

--[SCRIPT words_attributes_to_Style]

(*

Enregistrer le script en tant que Script : words_attributes_to_Style.scpt

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

<VolumeDeDĂ©marrage>:Users:<votreCompte>:Library:Scripts:Applications:Pages:

Il vous faudra peut-ĂȘtre crĂ©er le dossier Pages et peut-ĂȘtre mĂȘme le dossier Applications.


Ouvrir un document Pages contenant des mots soulignés

Aller au menu Scripts , choisir Pages puis choisir “words_attributes_to_Style”

Le script appliquera :

le style "Souligné" aux mots soulignés

le style "Accentuation" aux mots en gras

le style "Italic" (si vous l'avez créé) aux mots en italique.


--=====


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: words_attributes_to_Style.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 document embedding underlined words

Go to the Scripts Menu, choose Pages, then choose “words_attributes_to_Style”

The script will apply :

the named style "Underlined" to the underlined words

the named style "Emphasis" to bolded words

the named style "Italic" (assuming that you defined it) to italicized words.


--=====


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)

2011/11/13

2011/11/13 enhanced by Nigel Garvey in : http://macscripter.net/viewtopic.php?pid=145883#p145883

*)

--=====


on run

set Underlined_loc to my getLocalizedStyleName("Pages", "Blank.template", "STYLE_Underline")

set Emphasis_loc to my getLocalizedStyleName("Pages", "Blank.template", "STYLE_Emphasis")

tell application "Pages" to tell document 1

set character style of words whose underline type is single underline or underline type is double underline to character styleUnderlined_loc

set character style of words whose bold is true to character styleEmphasis_loc


(*

Assuming that you defined your own Italic style named "Italic", you may use : *)

try

set character style of words whose italic is true to character style "Italic"

end try

end tell

end run


--=====

(*

Example

set Heading8_loc to my getLocalizedStyleName("Pages", "STYLE_Heading 8")


Requires :

getLocalizedName()

*)

on getLocalizedStyleName(theApp, tName, x)


activateapplicationtheApp

tell application "System Events"

(application file of application process theApp as text) & "Contents:Resources:Templates:" & tName & ":Contents:Resources:"

return my getLocalizedName(theApp, x, result)

end tell

end getLocalizedStyleName


--=====


on getLocalizedName(a, x, f)

tell application a to return localized string x from table "Localizable" in bundle file f

end getLocalizedName


--=====

(*

List of default styles embedded in the Blank template :


"STYLE_Body" = "Corps";

"STYLE_Body Bullet" = "Puce du corps de texte";

"STYLE_Bullet" = "Puce";

"STYLE_Caption" = "LĂ©gende";

"STYLE_Emphasis" = "Accentuation";

"STYLE_Footnote Text" = "Texte de note de bas de page";

"STYLE_Free Form" = "Format libre";

"STYLE_Harvard" = "Harvard";

"STYLE_Header & Footer" = "En-tĂȘte et bas de page";

"STYLE_Heading 1" = "Sous-section 1";

"STYLE_Heading 2" = "Sous-section 2";

"STYLE_Heading 3" = "Sous-section 3";

"STYLE_Heading 4" = "Sous-section 4";

"STYLE_Heading 5" = "Sous-section 5";

"STYLE_Heading 6" = "Sous-section 6";

"STYLE_Heading 7" = "Sous-section 7";

"STYLE_Heading 8" = "Sous-section 8";

"STYLE_Heading 9" = "Sous-section 9";

"STYLE_Legal" = "LĂ©gal";

"STYLE_None" = "Aucun";

"STYLE_Normal" = "Normal";

"STYLE_Normal 22" = "Normal 22";

"STYLE_Normal 4" = "Normal 4";

"STYLE_Normal 8" = "Normal 8";

"STYLE_Numbered List" = "Liste numérotée";

"STYLE_Series_0" = "Series_0";

"STYLE_Series_1" = "Series_1";

"STYLE_Series_2" = "Series_2";

"STYLE_Series_3" = "Series_3";

"STYLE_Series_4" = "Series_4";

"STYLE_Series_5" = "Series_5";

"STYLE_Strikethrough" = "Barré";

"STYLE_TOC" = "Table des matiĂšres";

"STYLE_TOC Heading 1" = "Sous-section 1 de table des matiĂšres";

"STYLE_TOC Heading 2" = "Sous-section 2 de table des matiĂšres";

"STYLE_TOC Heading 3" = "Sous-section 3 de table des matiĂšres";

"STYLE_TOC Heading 4" = "Sous-section 4 de table des matiĂšres";

"STYLE_Title" = "Titre";

"STYLE_Underline" = "Souligné";

"STYLE_[Null]" = "[Nul]";

*)

(*

You may use more sophisticated custom styles embedding several properties:

baseline shift (real) : Raise or lower the target text.

bold (boolean) : Whether the font style is bold.

capitalization type (all caps/normal capitalization/small caps) : Whether a capitalization style is applied.

character background color (color) : The color of the character's background.

color (color) : The color of the font.

font name (text) : The name of the font.

font size (real) : The size of the font.

italic (boolean) : Whether the font style is italic.

ligatures (all ligatures/default ligatures/none) : Remove ligatures from the target text if the document is set to use ligatures.

name (text) : The name of the style.

outline (boolean) : Whether the font style is outline.

shadow (boolean) : Whether the text box content casts a shadow or not.

shadow angle (real) : The directional angle, in degrees, that the shadow is cast.

shadow blur (integer) : The relative amount of blur of images seen through the shadow.

shadow color (color) : The color of the shadow.

shadow offset (real) : The offset from the text box content that the shadow extends to.

shadow opacity (real) : The amount of opacity for the shadow, in percent.

strikethrough color (color) : The color of the strikethrough line(s).

strikethrough type (double strikethrough/none/single strikethrough) : Whether one or more lines are drawn through the characters.

subscript (boolean) : Decrease the font size and lower the baseline of the text.

superscript (boolean) : Decrease the font size and raise the baseline of the text.

tracking (real) : The space between text characters, in percent.

underline color (color) : The color of the underline(s).

underline type (double underline/none/single underline) : Whether the font style is underline.

*)

--[/SCRIPT]

--{code}


Yvan KOENIG (VALLAURIS, France) lundi 2 janvier 2012

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

My iDisk is : http://public.me.com/koenigyvan

Please : Search for questions similar to your own before submitting them to the community


For iWork's applications dedicated to iOS, go to :

https://discussions.apple.com/community/app_store/iwork_for_ios

Jan 13, 2012 10:31 PM in response to PeterBreis0807

No go = it didn't work

adequately = not in a helpful or useable format


That aside, the copying and pasting part of my problem won't resolve my real issue which is being able to select text based on free form style in order to apply a suitable ePub style en masse rather than one section at a time.


Thanks anyway Peter but no thanks. Your testing on your source file may have worked for you but your suggestions do not work for me with my source file which is a print-published book with graphics and layout. While I appreciate you taking the time to respond, I really only posted my results in case another user could save some time.


The script file posted by another user looks like it may be of more value to me.


I have raised my issues with streamlining ePub creation in Pages with my project manager at the Apple iBookstore and she will be pursuing some enhancements on my behalf.


My ePub creation hiccups aside, I appreciate that your intentions are good, but sometimes I find your comments assume a very poor level of comprehension and knowledge and can be mis-interpreted as being a little condescending.

Jan 13, 2012 10:43 PM in response to jamy.s

Exasperation perhaps.


"No go = it didn't work

adequately = not in a helpful or useable format"


Does not explain anything. They are mere rephrasing of the same non-descriptive terms.


There are degrees to how things work or don't and reasons that can be expressed as to why you are not satisfied with the results. The limits of how far it succeeds needs to be defined so that we can work out if there is any way to meet your requirements. Or not.


Peter

select text based on format (free form style text)

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