Jump to content
You must now use your email address to sign in [click for more info] ×

Building a Phone Directory Booklet


Recommended Posts

Hi, I'm trying to build a phone directory booklet with Affinity.  Let's go so far as to say that I can export the data from a spreadsheet and/or database in just about any conceivable format, I'm wondering what the right was is to pull it into Affinity Publisher using styles.

Say, for instance, that each entry should look like:

Smith, John
123 Main St.
Blankendale, MN 88304-0014
816.929.4030
https://johnisgreat.com/fake-url-for-example-purposes

Without going through every single entry manually (I have about 500 of them) and setting the style, what's the right way to do this in Affinity?  I'd love to hear from Serif.

In the end, I'm trying to produce a two-column staple-together booklet that I can update the bulk of the data via automation.  Advice, tricks, tips, and warnings welcome.

Link to comment
Share on other sites

17 minutes ago, wls said:

Smith, John
123 Main St.
Blankendale, MN 88304-0014
816.929.4030
https://johnisgreat.com/fake-url-for-example-purposes

 

What I would do is format the text like this as a plain text file

 

!!Smith...

@@123...

@@Blanken....

@@816....

##https:....

this can be done easily in a spreadsheet or a Database Export.

Import the text file of 500 entries and do a find and replace using the regular expressions

find: !!(.)

replace: \1 and include  the Paragraph Style. Name this will set the name and discard the !!

Rinse and repeat for @@ and ## using the appropriate styles.

Mac Pro (Late 2013) Mac OS 12.7.4 
Affinity Designer 2.4.0 | Affinity Photo 2.4.0 | Affinity Publisher 2.4.0 | Beta versions as they appear.

I have never mastered color management, period, so I cannot help with that.

Link to comment
Share on other sites

30 minutes ago, Old Bruce said:

Import the text file ... and do a find and replace using the regular expressions

Thanks. A quick mock up of this showed it might be a viable short-term solution.

The only snag I ran into was that each line imported was treated as a paragraph, as opposed to selective line breaks.

Should I be using something other than Place?  (Or does place have hidden options somewhere?)

Link to comment
Share on other sites

6 hours ago, Wosven said:

You can also use styles with "next style" option, to flow the text in different frames or pages.

Okay, this looks like some really cool clever magic with Publisher I haven't stumbled into yet, so take this slowly for me. I think there's two or three things happening which are about to turn on enlightenment for me (and ideally, anyone else reading this).

INSIGHT #1:  When doing an Edit / Paste Without Format of plain text into my newly created text area on a newly created document, my " [No Style]" appeared to treat each text line as a paragraph with gaps.  Because your example has all the lines visually together, I was thinking you some how did a line break (like you'd get with Shift-Return). Closer inspection shows that's not the case.

My faulty assumption was that a paragraph with "[No Style]" meant no styles at all.  That is, void of any styling.  What I missed due to cognitive blindness  due to size, weight, and lack of paragraph symbol is that above "[No Style]" is a style called Base. It defines a default 12pt space after each paragraph that can be zeroed.  As such, in the absence of a value that overrides this, it is used for the paragraphs, such as those I was pasting in.

The trickery you're doing with exporting and tabs is taking one-line records that are Tab-separated and converting them into multiple lines. I'd gotten to that part, but was trying to make each paragraph a record, with each line (using line breaks, like a poem would) being data. I like your styling solution much better, but I was attempting to do the above because [in reality] not all records will have the same repeating fields. e.g., Some might have more than one phone number or URL, some might have extra lines in the address, some might be missing information. I'm wondering if there's a way of doing both (perhaps with the regex trickery).

INSIGHT #2: I had missed that Styles had a Next Style (it's in the edit style pane under General for those reading this), it works the same way MS Word's does. When you hit return to go to the next paragraph, you can have it automatically select a different (or the same) style. But what I didn't know was that also in the style edit pane under Paragraph / Flow you could tell where the next paragraph should start.  While I've manually injected New Page, New Section, New Column in MS Word, it didn't dawn on me that with something like Affinity Publisher that could be done with a style.

My faulty assumption was that these were special inline breaks.  Nope, and there's a number of them to choose from.  One of those is In Next Frame.  I simply had no idea.

INSIGHT #3: I think I may be approaching my document wrong, and this is where I think you can set me straight, @Wosven. I've been treating Frame Text as simply a container on the page where text should go, which is just split up across multiple pages (and sometimes on the same page).

You, however, are doing something I haven't seen before and am not even sure how you're doing it (or if I'm understanding it right)...

 

TEACH ME OBI LAYOUT KENOBI

In your document (readers will need to download his example), step 4 says to "Apply Name style then next styles".  I'm not completely following.

While I know how to apply a style, it seems as if there's a way to cause a trickle-down effect for pre-existing text.  e.g., once Name is applied, it transitions to the next style, which applies to the next paragraph, and so on.

I'm led to believe this because step 1 has me create several styles and link them (name -> address01 -> address02 -> phone -> ...and back to name), step 2 and 3 have me past the data and turn it into [unstyled] paragraphs, and step 4 then does the apply, and step 5 has me use the results.

I doubt you're suggesting that I go through hundreds of records setting styles manually for each paragraph.

QUESTION 1: How do I do the "then next styles" part of the operation?  Is it a menu item?  Maybe I'm misunderstanding something.  Put another way, I can apply the Name style, but none of the chaining we set up happens.

 

When I scroll down to look at your examples, my mind is blown. Rather than have one text frame that's a column this data pours into, you've got a grid of Text Frames.  Ok, I get that you got Master pages going on behind the scenes, and that's where the grids live. And, wow, I get that's why you wanted the paragraph flow to go to the next text frame -- brilliant!

QUESTION 2: How did you make that grid of text frames so beautifully laid out such that each text frame was that same size -and- fit perfectly on the page? I feel like I missed a video tutorial somewhere.

 

I can't thank you enough, this has been a real eye-opener.

Link to comment
Share on other sites

3 hours ago, wls said:

Okay, this looks like some really cool clever magic with Publisher I haven't stumbled into yet, so take this slowly for me. I think there's two or three things happening which are about to turn on enlightenment for me (and ideally, anyone else reading this).

There's an interesting trick to use in APub once you have set your master pages (to get a better mastery of your document): to flow your text in the needed amount of pages, click on the red triangle of the text frame holding ctrl shift.

It will add as many pages as needed.

2020-04-26_204204.png.c994acfc9912651481fdbcca2bcb5724.png2020-04-26_204213.png.be3dad758ed8c459604e3afedc0be68d.png

 

3 hours ago, wls said:

 When doing an Edit / Paste Without Format of plain text into my newly created text area on a newly created document, my " [No Style]" appeared to treat each text line as a paragraph with gaps.  Because your example has all the lines visually together, I was thinking you some how did a line break (like you'd get with Shift-Return). Closer inspection shows that's not the case.

My faulty assumption was that a paragraph with "[No Style]" meant no styles at all.  That is, void of any styling.  What I missed due to cognitive blindness  due to size, weight, and lack of paragraph symbol is that above "[No Style]" is a style called Base. It defines a default 12pt space after each paragraph that can be zeroed.  As such, in the absence of a value that overrides this, it is used for the paragraphs, such as those I was pasting in.

The "No style" is made of Arial 12 pt with 12 below text style, one of the 10-12 fonts present on all the computers used in browser and as default font for apps that don't install fonts with them.

By default, APub come with a list of predefined text styles, as examples.  You can keep a document with those styles to check how they are made, but I had deleted all of them to keep only a "Base_text" and a "Base_Title" group styles.

"Base" will contains pertinent parameters. For example, Base_text (=body) with justification, hyphenation, smaller size than Header (Base_Title), that'll be left align, bold, in another font.

I'll only have to create new styles based on one of them later, for them to get those proprieties. If at some point, I want to change the font or the colour for the Header, I only have to modify "Base_Title", and they'll use the same font/colour. That's the principle, if the children styles keep the settings to "no change"… 

 

3 hours ago, wls said:

The trickery you're doing with exporting and tabs is taking one-line records that are Tab-separated and converting them into multiple lines. I'd gotten to that part, but was trying to make each paragraph a record, with each line (using line breaks, like a poem would) being data. I like your styling solution much better, but I was attempting to do the above because [in reality] not all records will have the same repeating fields. e.g., Some might have more than one phone number or URL, some might have extra lines in the address, some might be missing information. I'm wondering if there's a way of doing both (perhaps with the regex trickery).

It was a trick for data from a sheet, since it's common.

If your data are in line as in your example, you can keep only a small amount of styles (instead of having 2 for the address), but group those line using line breaks, they'll be treated as a single paragraph. The same for more than one phone number.

You can do this or apply "next styles" and correct each time there's an error… If you work only one on the ducoment, it should be the same, in the long run, if you need to import data more than once, it's better to have the data correct instead of correcting the formating.

 

3 hours ago, wls said:

step 4 says to "Apply Name style then next styles".  I'm not completely following.

For this you need to select more than 1 paragraph, and magic applies:

2020-04-26_212708.png.893082410bd207950fc35fa34ea74878.png2020-04-26_212714.png.437b3dbee10c23a9c89fd542bf92c444.png

 

3 hours ago, wls said:

I doubt you're suggesting that I go through hundreds of records setting styles manually for each paragraph.

No need, you just need the styles: name > address > phone > site > name.
Note that the last style need to buckle back to the 1st style, so all the selected paragraphs can be styled.

If at some point there's an error, you forget a line break between web sites, you only need to add it, select this paragraph and all the remaining text and apply the styles appropriately, for example: "Apply 'Site' and next".

 

3 hours ago, wls said:

QUESTION 2: How did you make that grid of text frames so beautifully laid out such that each text frame was that same size -and- fit perfectly on the page? I feel like I missed a video tutorial somewhere.

It's really simple (less if you want to make stickers for adresses and need to check the margin and position of the frames, but in this case, test printing 1 page and looking it against the stickers page by transparency if the text is well positioned or need to be moved a little depending of your printer).

For 8 × 2 frames

Create 1 frame of the area of your whole page, use the transform panel and divide width by 2 and height by 8.
You dupplicate this frame to put it on the right.

Next step, you select those frames, use the shortcut ctrl+j to dupplicate them and you move them below the 1st row. If you've done this right in one move, next time you do ctrl+j, the frames should be dupplicated and positioned at the same distance too. You repeat until the end of the page.

Last step: linking the frames.

For 8 × 3 frames

Same trick, but the 1st row contains 3 frames (divide by 3) before using ctrl+j.

 

Once you know the shortcuts, it's easy :)

Link to comment
Share on other sites

@Wosven ... that. was. incredible.

I had no clue about the Shift - Red Triangle trick.  Didn't know you could select multiple paragraphs and apply styles in that manner.  Nor did it even occur to me to build pages using transformation operators like /=2, /=3, /=8, etc. for a value.  You have just saved me hours upon hours.  (I wish I had recorded the actual draw-drop for you that happened as this started working in my own document.)

I tell you, the moment those folks at Serif put out a book on Publisher, I'm gonna get a copy, sit down, and read it cover to cover.  While I've watched every Publisher tutorial they have (and browsed the help),  you've left me wondering just how much more I don't know.

This was so valuable. Thank you for taking the time to write such an amazing and comprehensive response.  I'm sure others will get just as much value as I did.  Again, thank you.

Link to comment
Share on other sites

On 4/25/2020 at 3:30 PM, wls said:

The only snag I ran into was that each line imported was treated as a paragraph, as opposed to selective line breaks.

This thread is relevant to that problem.  The discussion got a bit side-tracked, but the essential bit about input line breaks being treated as paragraph breaks, and how to deal with it, is clearly stated

 

Link to comment
Share on other sites

@sfriedberg, thanks for addressing this particular point.

While I already have a workable solution, thanks to @Wosven's great explainers, there's still this feature wishlist for Affinity Publisher (although this is likely the wrong forum for it).

If you open the attached sample.html file in a browser, you'll see it contains a header, paragraph tags, and some paragraphs have line breaks. The HTML clearly conveys this intent:

...
		<p>Paragraph one.</p>

		<p>Paragraph two<br/>
		with some<br/>
		line breaks.</p>
		<p>Paragraph three.</p>
...

 

If you select the rendered browser contents and copy and paste it into an editor, like Sublime, you'll see that it adequately represents in text form what's going on, suggesting that the paragraph and line breaks are being conveyed.

It would be nice if Affinity Publisher was able to preserve line breaks (such as in the case of copying poetry).

Browser-And-Text.png.4fcc4387b674c67fb8c5a23ed58509b0.png

While I'm not talking about importing the .html file itself (though, that'd be cool), if the rendered content simply had the <br/> tags honored as soft-returns and the <p/> tags as actual paragraphs, this would be enough.

The point here is that not all of us here are hand-jamming text straight into Affinity, but rather using other applications or are actually generating our own exports. Preserving line breaks, at least to distinguish from paragraphs, is all we ask.

Working around it is fairly brutal at the moment.  I'm not keen on having to do a bunch of manual data transformations after each import.

sample.html

Link to comment
Share on other sites

11 minutes ago, wls said:

If you select the rendered browser contents and copy and paste it into an editor, like Sublime, you'll see that it adequately represents in text form what's going on, suggesting that the paragraph and line breaks are being conveyed.

It would be nice if Affinity Designer was able to preserve line breaks (such as in the case of copying poetry).

Isn't it easy enough...at least until such time as whatever is actually wanted...to open such text in Word or another word processor, copy & paste (or save/open) into APub?

line breaks are preserved. Word:

Capture_000621.png.0e5485743232edc78b32b0a0288f7807.png

APub (via copy/paste):

Capture_000622.png.c4a86a2787f72f05fbb367d41fb31523.png

Link to comment
Share on other sites

Interesting discovery, @MikeW.

As a side note, I don't use MS Word specifically because of the "subscription" { :cough: rental! } model, which incidentally what also got me into the loving arms of Serif and their Affinity line of products (dropping the whole of the Adobe product line).  But... I do use LibreOffice.  So this falls into the category of "another word processor" as Mike suggests. As always, the point is to make sure that solutions are independent of requiring other vendor products or specific implementations. As you'll see below, with LibreOffice, I got lucky. However, with Pages, I didn't. Not all word processors are the same.

For those reading, Mike discovered something interesting here.  If you copy from Safari to Affinity it does not preserve soft-returns.  But if you use the same copy/paste buffer to Word or LibreOffice, it does, ...wait for it... but then if you copy that content and paste it over in Affinity Publisher it does retain the soft-returns.

This is a viable workaround, but it's inelegant from a software design standpoint coming from a top-caliber development shop such as Serif.

Why should a user have to get a third-party tool involved in the workflow pipeline in order to preserve a simple copy'n' paste format?

This is exactly Serif's argument for using Publisher and not InDesign -- that you don't have to switch between tools to get stuff done.

Given that Mike just proved that the clipboard has the required information directly from the browser copy, and that it can be preserved when coming from other applications, there's no excuse not to take the clipboard as-is.

An Aside:  You can also Place a saved document from LibreOffice directly in to Affinity as well and get the soft line-breaks, however it doesn't recognize the .oft extension. Instead, you need to save it as a .docx format first.

Link to comment
Share on other sites

I think I mentioned...or another word processor...

The why of it all? Because it isn't in Affinity applications. May never be?

Let's pick on InDesign. It has merging, right? Other than the fact Adobe hasn't ever shown it any love since it was included and has the same bugs it always has, it's a crappy merge. Word et al is superior in merging. 

Which is one reason why I paid for a $400 plugin that costs $199 to upgrade it. Which I mostly use the QXP version. So figure out my yearly upgrade costs for that single add on (and I use 4 such costly add ins and several less expensive ones).

While I would like not to have to use "work arounds" even if free, it is always going to be necessary no matter what applications I use. It's a fact of life. 

As regards Serif's applications, they too will never have X, Y or Z functionality. Affinity applications will always need extended for one or more functions they lack.

I personally have no issues with that fact. Except the functionality I want in, of course ;^) 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.