How to put line numbers on existing blank pages?
I have a document comprising of a few hundred blank pages (different page sizes and orientations) that I wish to put line numbers on. I can enable line numbering in Writer, however when I hold the enter key down, and get to the end of the first page, a new page is created. I don't want this, as I want the line numbers to flow onto the next blank page. Attached at the bottom is a small sample of the blank pages that I wish to fill with line numbers (various sizes and orientation). I need a quick way to do this, as in practice I will have hundreds of blank pages, and the order,orientation, size of these blank pages must be preserved. I simply want line numbers from the top to bottom on these existing blank pages. Is there a setting I can change in Writer to enable this, or alternatively does anyone have any example of a macro script that would work?
EDIT - I have found an ugly hack to do what I want to do. But am still looking for a way to do this in Writer. Below is the approach I have taken:
The only way I have found to accomplish my task is to fill up a single page completely with a text character and export to PDF. I then export my few hundred blank pages to pdf and use a simple command line program to overlay the single page with the text character onto the hundreds of blank pages. Once this is complete, I then convert this pdf to ODT and I once again have my blank pages in writer, but these are filled with a single text character. To get rid of this text character, I then use "find and replace" and replace the character with a blank space. I then turn on line numbering and have line numbers on my blank pages. This works perfectly for what I want to achieve, but I can't believe there is no way to put line numbers on existing blank pages in Writer, either by a macro or some other trick.
Test file created by leory method: C:\fakepath\test.odt
You haven't explained what you really want, and what you expect will happen when you add text. Do the numbers have to be printable? See your previous question 287282
If you just want printable blank pages with numbers at the beginning using your layouts then you could just do a numbered list on the first page. Click on first page and press F12, click Edit > Direct Cursor Mode then carefully click at the bottom of your page just out from the margin, the page should fill with numbers, click Edit > Direct Cursor Mode to turn off Direct Cursor Mode.
Copy the list and paste it on each subsequent page.
You are using 5 names for 2 page styles. You can use 2 styles (MP0 and MP1), activating headers and adding a frame to the header with a table with numbers. See sample file line numbers on existing blank pages.odt with table in MP0 style.
Tested with LibreOffice 6.4.7.2 (x86); OS: Windows 6.1.
Add Answer is reserved for solutions. Please, click edit below your question to add more information.
Good point @LeroyG. I would be inclined to combine both, although I don't understand the purpose of the exercise.
Create a frame anchored to page (so it is outside the text, Wrap to right. There seems to be a fixed number of pages so insertion of pages wouldn't be an issue).
Take the numbered list I described from the first page and paste into frame. Adjust the frame so the numbers accurately align with some dummy text, ensure same style as body.
Copy and paste it into every page. Sequential numbering from 1 to around 16000.
I just realize my mistake:
So my approach does not work.
By the way, tables only allow 8192 rows.
Thanks Earnest, I think the list approach could very well work, but how can the numbers distance from the left margin be changed? If possible I want the numbers in the list flush with the left margin.
Secondly, you say about copying the list and pasting it on each subsequent page. This works, but is there a way to automate this process with a macro? Do you have an example of macro code that I could use for this?
Many thanks
@Earnest Al: the frame is not anchored To page. If it is, the frame must effectively be manually inserted on every page. It is in fact anchored To paragraph in the header. Thus it is automatically repeated on every instance of the same page style.
@ajlittoz I don't know the purpose of the exercise but it seems to have a definite number of blank pages of differing styles. If the frame is anchored to the header (there is no room for a header in the sample given) then I don't know if the the numbering would remain sequential from style to style, but it would require more work on each change of page.style.
You are absolutely right, Anchored to page can cause big problems. An inserted page later on would not get a sequentially numbered frame and might break the numbering if there were an attempt to paste a frame from another page.
Another way to do this would be to fill every existing page with line breaks and then turn on numbering (like in the Picture Example below). But is there some automatic way to fill every existing page with line breaks, either with some macro code or other automated way?
Picture Example
The fact that we try to outsmart Writer clearly shows this track is not the good one.
Let's get back to the original problem: annotate a document. You said it is a PDF. Who created it? If you did, make a Writer version of it and work with it. If you annotate somebody else's work, then it is not in its final shape. Request an editable copy of it.
Annotations are best made with the comment feature. Proof reading fixes use the track changes feature.
As a last resort, find some OCR application to transform the PDF into plain text at least. You'll format it once and work on it from there on.
I did not create the PDF documents, so don't have the source. OCR is a very bad approach, as it is time consuming and can change the formatting. PDF editors are a bad option, as I can only work on one page at a time. For thousands of pages this is tedious. If I can just find a way to fill these existing blank pages with line breaks, then I can turn on numbering in writer. It's then so simple and quick to overlay one pdf to another pdf.