Scribus Forums

Scribus => General Discussion => Topic started by: SuburbanWorrier on March 16, 2015, 03:25:38 PM

Title: Pageobject position
Post by: SuburbanWorrier on March 16, 2015, 03:25:38 PM
Hi All,

Why oh why oh why is pageobject position calculated from a global datum and not via the page?

I was trying to create a ~120 page document which basically displays one image per page.  All of my images are sequentially numbered so I thought it was an ideal candidate to try out a bit of scripting to generate the pages.
I reverse engineered a sample double page spread and quickly (by my standards) generated 120 pageobjects which I pasted directly into my .sla.

I'd incremented the OwnPage, PFILE and ItemID values and used different fragments for my left and right page placements without looking too closely at the position values. It took a fair while for me to realise that my images were stacked 60 deep on just two pages of the 120!

I'm totally baffled as to why pageobject position isn't relative to the page itself. What should have been a trivial task quickly escalated beyond my scripting ability and I had to generate the document by hand.

What's the rationale for this sla design decision??
Any direction on how I'd script a task like this in future would be much appreciated too.

Kind regards
Title: Re: Pageobject position
Post by: a.l.e on March 16, 2015, 03:55:33 PM
hi suburban worrier,

how are you scripting your document?

by tweaking the .sla or by using a python script inside of scribus?

the second one is the preferred way and should not have the issue you're pointing to (which lets met think you're using the first one :-)

if you want to stick to an external solution, IIRC you will have to tweak OWNPAGE, which references the page that defines the start coordinates.

have fun
a.l.e
Title: Re: Pageobject position
Post by: SuburbanWorrier on March 16, 2015, 04:46:18 PM
Hi a.l.e,

Quick'n'dirty - I'm modifying the .sla externally. Previously I've used a spreadsheet to chop up, manipulate and then restitch (parts of) the .sla
As I'm trying to become more developer minded I made a little python script to insert my incrementing values into a pageobject string.

I did tweak OwnPage but it makes not the slightest difference. When I looked into the image manager each page had an image assigned even though they all ended up on just the two pages. I repeated my process and removed the coordinates while maintaining OwnPage values as I wondered whether the images would then default to inheriting the page coordinates.  They didn't, instead ending up as a stack of 120 images at the document origin.

I'm really surprised as preferences like spacing between pages will be implicated in an objects global position (not that I've had chance to test this yet).

I'll have a go at using the correct approach when I find the time. Actually in this case it didn't take too long to manually edit a file where I duplicated the first two pages.  All I did was edit the image paths in a text editor.

Thanks for the response.