[Dropped] Unable to throw to a new page

Writing a book, Automating Document Production - Discuss your special needs here
Post Reply
berbol
Posts: 7
Joined: Sat Aug 06, 2022 10:20 am

[Dropped] Unable to throw to a new page

Post by berbol »

Greetings from a new forum member, wondering if anyone can help me, or direct me towards where I might find some help ...

I have a fairly large Lotus Notes database (over 10,000 entries and more than 250Mb by now) which I'd like to output to formatted rich-text records — 26 in all, listed and sequenced alphabetically by surname initial — and at the end of every individual's record, skip to a new page in my output report. I want to copy and paste each of the 26 resulting records into a vanilla blank Open Office text document. So my nett result is 26 documents, exported as 26 PDFs, not at all difficult to do manually.

And for my purposes, it works brilliantly. From experience, we know that the content of these records is far more important than a pretty presentation, but even within that guideline, Notes 9.0 (IBM's last version of the product) is fairly good at simple formatting, allowing for the insertion of tabs, font selection (and size, weight, colour, attributes such as bold and italic, etc), and in theory at least, limited forms control that should allow throwing to a new page by appending a command string to a rich text field where the output record is being accumulated. SHOULD do that, but it doesn't. I see the same lozenge blob that others have commented on, and (unlike all the other formatting commands) it has no effect.

Any ideas? I should perhaps add that this has all been done and will be completed as a no-charge, voluntary effort for a heritage non-profit of which I've been a member for over 20 years.

Thanks in anticipation for any help,

BEB


Notes client 9.0 with Windows 7 and Open Office 4.1.13, but identical results under Windows 11.
Last edited by MrProgrammer on Sun Nov 06, 2022 4:43 pm, edited 1 time in total.
Reason: Dropped: From berbol -- I'll … let you know how I get on
OpenOffice 4.1.13 on Windows 11
John_Ha
Volunteer
Posts: 9584
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: Unable to throw to a new page

Post by John_Ha »

Please upload a (small?) file showing the problem so that it can be analysed.

Click Full Editor and Preview. Click the Upload attachment tab below where you type for files up to 128 kB max; or use a file share site such as mediafire, Dropbox or Google Drive for a larger file.

I think what you are saying is that you get a text file with consecutive entries but you want to throw a new page after each entry so each entry is on its own page. Some ideas are
  • Can you get Notes to do it for you?
  • Can you produce a Notes report with page throws? I would have thought there was an "each entry to its own page" setting.
  • Can you add a dummy field to Notes which gets output in your file and which can be changed by a regular expression to a page throw?
  • Can you set a fixed number of rows per entry (ie have lots of blank lines) which naturally fills a page so each entry occupies a full page without needing a page throw?
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
User avatar
RoryOF
Moderator
Posts: 34786
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Unable to throw to a new page

Post by RoryOF »

Bear in mind that a file with 10,000 pages will be unwieldy, and may (almost certainly will) break Open- or LibreOffice. Such a large file is an obvious candidate for a Master File.

If the first entry of each individual's record has a unique paragraph style, that style can be set to start on a new page. Also, the Alphabetic divisor (the A, B, C etc) by which you wish to divide your text source should also have a different unique paragraph Style.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
John_Ha
Volunteer
Posts: 9584
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: Unable to throw to a new page

Post by John_Ha »

RoryOF wrote: Mon Sep 05, 2022 10:13 pm If the first entry of each individual's record has a unique paragraph style ...
And even if it doesn't it should be very easy to use Notes to give it a unique style. Import it to AOO and set that paragraph style to start on a new page. I was always convinced the solution lay in Notes rather than an AOO workaround.

I doubt 10 000 entries will be a problem as I expect each of the 10,000 entries will have relatively few words occupying a fraction of a full page. I doubt it is more than 2,000 full text pages as continuous text before setting it to separate pages which is easily handled.

If necessary separate PDF files Aa to Ad.pdf and Ae to Am.pdf can be joined with PDFSAM.
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
berbol
Posts: 7
Joined: Sat Aug 06, 2022 10:20 am

Re: Unable to throw to a new page

Post by berbol »

Rory / John,

May I post my reply as a Personal Message to you both? While it's only two or three screenshots, my data contains too many names to scrub completely, and might (10,000 : 1) just disclose a known name or two to a reader if broadcast too publicly. I'd also like to explain my motivation, and why I've been quiet about it for so many weeks now ...

BB
OpenOffice 4.1.13 on Windows 11
John_Ha
Volunteer
Posts: 9584
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: Unable to throw to a new page

Post by John_Ha »

I am certain the correct solution is to get Lotus Notes to output a report with page throws or with a heading style which you can style in AOO to include a page throw.

We could look at doing it with your output file. Please upload a small output file so that it can be analysed.

Press POSTREPLY and click the Upload attachment tab below where you type (128 kB max); or use a file share site such as mediafire, Dropbox or Google Drive for a larger file.

If the file has confidential material in it, you can obscure the contents without affecting the structure too much (lines will spill differently because different characters have different widths) by changing every lower case alphabetic character to an " x ". Select all the text (Ctrl+A) and:

Edit > Find and Replace
Find box [a-z]
Replace box x
Options: Match case: YES, Regular expressions: YES
click Replace all

Repeat the above using [A-Z] and X to scramble the upper case letters, and [0-9] and 0 to scramble numeric data.
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
berbol
Posts: 7
Joined: Sat Aug 06, 2022 10:20 am

Re: Unable to throw to a new page

Post by berbol »

Thanks, John, will try at the next opportunity I get, hopefully within 24 hours.
OpenOffice 4.1.13 on Windows 11
John_Ha
Volunteer
Posts: 9584
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: Unable to throw to a new page

Post by John_Ha »

The Alternative Find and Replace add-on says it allows you to search for something and replace what was found with a manual page break.

I could not get it to work in Alt F&R nor by using \m as the Replace argument in a regular expression search.
Attachments
Clipboard01.png
Clipboard01.png (88.73 KiB) Viewed 7296 times
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
berbol
Posts: 7
Joined: Sat Aug 06, 2022 10:20 am

Re: Unable to throw to a new page

Post by berbol »

John, I use a straight vanilla OO, ie, no add-ons, and when I use Extension Manager, I see over 100 colourful icons, many with names no more descriptive than “extension 4792”. When I search for “Advanced Find & Replace Add-on for Open Office”, I’m again presented with lots of options, none of which suggest THIS is the version I want … but are you now saying that this particular Add-on doesn’t work, in any case?
John_Ha
Volunteer
Posts: 9584
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: Unable to throw to a new page

Post by John_Ha »

It didn't work for me - I don't know why.
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
User avatar
keme
Volunteer
Posts: 3738
Joined: Wed Nov 28, 2007 10:27 am
Location: Egersund, Norway

Re: Unable to throw to a new page

Post by keme »

Haven't used Lotus anytime this century, so I may be missing something obvious, or I may be missing something in past responses (responding from phone right now). Still, I take my chances:

As far as I recall, you can register a Notes database as a Base data source, available directly in Word Writer.

Instead of employing the "report" approach (in Notes or Base), could you use the Writer mailmerge functionality? Merge inserts a break after each record, unless you specifically request "next record" on the template page.
Last edited by keme on Wed Oct 12, 2022 7:22 pm, edited 1 time in total.
berbol
Posts: 7
Joined: Sat Aug 06, 2022 10:20 am

Re: Unable to throw to a new page

Post by berbol »

Possibly; certainly not easily, though. The only thing I seem to be missing is the magic machine-independent code needed in a text string to cause a skip to a new page, because all my other formatting (tabs, new lines, font settings, etc.) is exactly what I wanted to see. Notes would have had me believe that all that was needed was to Append (10) [or something similar] to insert the needed New-Page command in my rich-text output stream and drop that into my OO document ... only that achieved nothing, other than displaying a square shape where I would've preferred to see a new page. It's true, that approach could have been retired or withdrawn from Notes any time in the last 30 years and I wouldn't have noticed. But thanks, anyway.
OpenOffice 4.1.13 on Windows 11
John_Ha
Volunteer
Posts: 9584
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: Unable to throw to a new page

Post by John_Ha »

LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
John_Ha
Volunteer
Posts: 9584
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: Unable to throw to a new page

Post by John_Ha »

You can do it pretty easily by extracting content.xml and editing with Find and Replace to replace a dummy database field you exported with a manual page break. Replace All will do all in one go. Replace content.xml in the odt and all is done.

See test.odt where I inserted a page break after DUMMY on each page.

See content.xml extracted from it below. Note how Style P1 includes a page break and how a page break is inserted after DUMMY by using Style 1.

Code: Select all

...
<style:style style:name="P1" style:family="paragraph" style:parent-style-name="Standard">
		<style:paragraph-properties fo:break-before="page"/>
	</style:style>
</office:automatic-styles>
<office:body>
<office:text text:use-soft-page-breaks="true">
	<text:sequence-decls>
		<text:sequence-decl text:display-outline-level="0" text:name="Illustration"/>
		<text:sequence-decl text:display-outline-level="0" text:name="Table"/>
		<text:sequence-decl text:display-outline-level="0" text:name="Text"/>
		<text:sequence-decl text:display-outline-level="0" text:name="Drawing"/>
	</text:sequence-decls>
	<text:p text:style-name="Standard">Cat</text:p>
	<text:p text:style-name="Standard">Dog</text:p>
	<text:p text:style-name="Standard">DUMMY</text:p>
	<text:p text:style-name="P1"/>
	<text:p text:style-name="Standard">Sheep</text:p>
	<text:p text:style-name="Standard">Cow</text:p>
	<text:p text:style-name="Standard">DUMMY</text:p>
	<text:p text:style-name="P1"/>
	<text:p text:style-name="Standard">Pig</text:p>
	<text:p text:style-name="Standard">Goat</text:p>
	<text:p text:style-name="Standard">DUMMY</text:p>
	<text:p text:style-name="P1"/>
	<text:p text:style-name="Standard">Horse</text:p>
	<text:p text:style-name="Standard">Ox</text:p>
	<text:p text:style-name="Standard">DUMMY</text:p>
	<text:p text:style-name="P1"/>
</office:text>
...
So, in your file, search for all occurrences of

Code: Select all

"Standard">DUMMY</text:p>
and replace with

Code: Select all

"P1"/>
You will have deleted DUMMY and replaced it with a page break.
Attachments
test.odt
(8.91 KiB) Downloaded 456 times
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
berbol
Posts: 7
Joined: Sat Aug 06, 2022 10:20 am

Re: Unable to throw to a new page

Post by berbol »

John, Looks very promising, and much more what I had in mind. I'll give it a crack at the first opportunity, and let you know how I get on. Thanks.
BB
OpenOffice 4.1.13 on Windows 11
John_Ha
Volunteer
Posts: 9584
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: Unable to throw to a new page

Post by John_Ha »

I use Notepad ++ with the XML plugin to edit XML files.

An important thought. Before you extract content.xml add at least two page breaks. This will ensure that any metadata associated with page breaks is inserted into the file.

1. Open content.xml
2. Plugins > XML Tols > Pretty print with line breaks
3. Do the edits
4. Plugins > XML Tools > Linearise
5. Save.
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
berbol
Posts: 7
Joined: Sat Aug 06, 2022 10:20 am

Re: Unable to throw to a new page

Post by berbol »

Thanks again.
OpenOffice 4.1.13 on Windows 11
Post Reply