[Python] [Writer] Remove empty pages?

Keyboard macros or custom scripts

[Python] [Writer] Remove empty pages?

Postby yijinger » Thu Apr 22, 2021 11:49 pm

Hello,

I compiled my document and found some empty pages. How can I look through each page and remove empty ones? I could not find anything useful for my case.
LibreOffice 6.0.7.3 on Linux Mint 20
yijinger
 
Posts: 12
Joined: Fri Apr 02, 2021 8:00 am

Re: [Python][Writer] Remove empty pages?

Postby JeJe » Fri Apr 23, 2021 12:04 am

What do you mean by 'empty page'... a page of blank paragraphs or unwanted manual page breaks?
Openoffice 4.1.6
Windows 8
JeJe
Volunteer
 
Posts: 1650
Joined: Wed Mar 09, 2016 2:40 pm

Re: [Python][Writer] Remove empty pages?

Postby yijinger » Fri Apr 23, 2021 5:39 am

Blank pages appeared due to paragraph breaks - the last element on the previous page inserts "PARAGRAPH_BREAK", and it adds another page, which does not fill. But if I insert a condition concerning this paragraph break, I observe bugs with the previous paragraph.
LibreOffice 6.0.7.3 on Linux Mint 20
yijinger
 
Posts: 12
Joined: Fri Apr 02, 2021 8:00 am

Re: [Python][Writer] Remove empty pages?

Postby Bidouille » Tue May 18, 2021 3:35 pm

In theory, any printer driver is able to ignore blank pages.
User avatar
Bidouille
Volunteer
 
Posts: 462
Joined: Mon Nov 19, 2007 10:58 am
Location: France

Re: [Python] [Writer] Remove empty pages?

Postby yijinger » Tue May 18, 2021 7:24 pm

But my document is not for printing. The problem still not solved.
LibreOffice 6.0.7.3 on Linux Mint 20
yijinger
 
Posts: 12
Joined: Fri Apr 02, 2021 8:00 am

Re: [Python] [Writer] Remove empty pages?

Postby RoryOF » Tue May 18, 2021 7:29 pm

Look at your document in OpenOffice; turn on /View /Non printing Characters, and decide why there are blank pages. It is your document - you can see it, we can't.
Apache OpenOffice 4.1.10 on Xubuntu 20.04.3 (mostly 64 bit version) and very infrequently on Win2K/XP
User avatar
RoryOF
Moderator
 
Posts: 32968
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: [Python] [Writer] Remove empty pages?

Postby yijinger » Wed May 19, 2021 7:48 pm

Sorry, but I don't see any reason to make this problem personal. I'd like to see a pure solution: you get a document from somewhere and you have to remove blank pages from it. The problem looks simple in this wording, but how simple the solution is?
LibreOffice 6.0.7.3 on Linux Mint 20
yijinger
 
Posts: 12
Joined: Fri Apr 02, 2021 8:00 am

Re: [Python] [Writer] Remove empty pages?

Postby RoryOF » Wed May 19, 2021 8:00 pm

You still see a document that we cannot see. We can only guess what you are seeing and what you have done. You want a solution? Then give us a sample document.

This is like sending one's daughter to doctor to say her father (you) has a pain here(^); Doctor can only guess.
Apache OpenOffice 4.1.10 on Xubuntu 20.04.3 (mostly 64 bit version) and very infrequently on Win2K/XP
User avatar
RoryOF
Moderator
 
Posts: 32968
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: [Python][Writer] Remove empty pages?

Postby Hagar Delest » Thu May 20, 2021 8:12 am

I guess that you've to detail a bit this part:
yijinger wrote:Blank pages appeared due to paragraph breaks - the last element on the previous page inserts "PARAGRAPH_BREAK", and it adds another page, which does not fill. But if I insert a condition concerning this paragraph break, I observe bugs with the previous paragraph.

I understand you add a paragraph break to prevent a bug. Fixing that bug in the previous paragraph may eliminate the need of the paragraph break and thus the blank page.
LibreOffice 7.2.1 on Xubuntu 21.04 and 7.2.1 portable on Windows 10
User avatar
Hagar Delest
Moderator
 
Posts: 29980
Joined: Sun Oct 07, 2007 9:07 pm
Location: France


Return to OpenOffice Basic, Python, BeanShell, JavaScript

Who is online

Users browsing this forum: No registered users and 5 guests