Scribus Forums

Scribus => Scripts and Plugins => Topic started by: chackem on August 07, 2023, 11:10:47 PM

Title: Resize Page
Post by: chackem on August 07, 2023, 11:10:47 PM
My ultimate goal is to create a pdf that is the exact size of text I have converted to outlines through scribus python scripting.

I've run in several problems.

1) I can't figure out how to change the size of the current document, master pages or pages at all.

2) If I use traceText, the resulting outlines are grouped with a name that can't be used in the script because it wasn't directly set.

3) If I use the python script to select an item THEN export as an eps, the eps will only contain the selected item which would work, but because of #2 I have to select all objects on the page. But then I can't figure out how to set the name for the object so I can refer to it in the rest of the script.

Any advice? Are these limits to the python scripting or is the documentation just not very user friendly? The documentation I'm using is: https://impagina.org/scribus-scripter-api/


Thank you for your help.
Brady
Title: Re: Resize Page
Post by: PatJr on August 08, 2023, 04:01:03 AM
changing the page size
File>Document Setup
change the page size and margins and bleeds
be sure to check the "Apply changes to all pages" and "Apply changes to all master pages"
 
Title: Re: Resize Page
Post by: chackem on August 08, 2023, 05:37:51 AM
I need to be able to do this through the python script, which I run through the command line without using the gui using xvfb-run.

Title: Re: Resize Page
Post by: a.l.e on August 13, 2023, 10:03:01 PM
hi brady,

i'm working on creating a patch for adding python function that can manipulate the page size.

i plan to add:

- getPageSizeList() # all active page names
- setPageNSize(pageSizeName)
- setPageNWidth(width)
- setPageNHeight(height)
- setPageSize(pageSizeName)
- setPageWidth(with)
- setPageHeight(height)

I hope that (i can get it done soon and that) it can be added to 1.5.9...
Title: Re: Resize Page
Post by: digirew on April 16, 2024, 08:17:44 PM
Hi A.l.E,


Just curious if this ever made it into a release?

Really looking forward to modifying the page width and height via. scripts.

Title: Re: Resize Page
Post by: a.l.e on April 16, 2024, 09:47:05 PM
it's in https://impagina.org/scribus-scripter-api/page/ so it should also be in 1.6.0 ...

have you tested it?
Title: Re: Resize Page
Post by: digirew on April 16, 2024, 10:18:10 PM
I only use that website you mention for scripting scribus.

Im using 1.6.1 and I get the below error when I try to set scribus.setPageHeight(objheight)


AttributeError: module 'Scribus' has no attribute 'setPageHeight'.


It makes me believe that it does not exist in 1.6.1?

Title: Re: Resize Page
Post by: a.l.e on April 17, 2024, 09:45:08 AM
eh eh, that information would have helped me focus on the right path for replying to your previous question.

and: there is no patch yet for it.
i will check what is still missing...
Title: Re: Resize Page
Post by: a.l.e on April 17, 2024, 06:24:07 PM
this is the reason why the patch has not been finished yet:

0017203: "document setup > page size" does not set the page size for the future pages in the document (https://bugs.scribus.net/view.php?id=17203)
https://bugs.scribus.net/view.php?id=17203