Scribus Forums

Scribus => Layout Issues => Topic started by: kylar.merrell on June 12, 2021, 03:28:14 AM

Title: How to easily add image frame to 100+ pages
Post by: kylar.merrell on June 12, 2021, 03:28:14 AM
I need an image frame added to 106 pages. Each frame will contain a different image. How can I do this without having to manually add an image frame in the exact same spot on each page.
Title: Re: How to easily add image frame to 100+ pages
Post by: Nermander on June 12, 2021, 09:34:41 AM
I would create the frame and place it correctly on one page, then send to scrapbook.

Then for each page where the frames is to be added, a double click in in the scrapbook is the only extra action needed in addition to the Get image you would still have to do (since each frame will have a different image).

If the frames were already added, you would still have to select every frame (single click) and do Get image.

But I have to confess I am not sure wheter a frame inserted from the Scrapbook autimatically becomes selected.
Title: Re: How to easily add image frame to 100+ pages
Post by: RobSay on June 12, 2021, 01:18:43 PM
Hello - this is a classic problem for which scripter is the solution.

If you think about the repeated actions *as a user* - they go something like this:

If you create a new scribus document with one page - then select Script Menu > Show Console and run this (with your image file name):

# create the image frame .. parameters are x,y,width,height - using the units of your document (mine are mm)
someImageFrame = createImage(10, 10, 100, 100)
# load the image into the frame just created - note the forward slashes for windows (file type can be anything you can do manually)
loadImage('D:/Some/path/to/my/images/processed001.eps', someImageFrame)
# scale the image to the frame size (there are ways to scale the frame to the image
setScaleImageToFrame(scaletoframe=1, proportional=1, name=someImageFrame)
# add a new page (uses default master page if not named)
newPage(currentPage()+1)

That automates all of the user actions listed above. All of the scripter functions are here: https://impagina.org/scribus-scripter-api/ Have a look at the definitions of the commands I used in the script - and you should be able to see how they work. For example - click on 'Images' in the left hand menu and the first function listed is 'createImage'

You *could* just create a massive script (in notepad) with that block repeated 106 times - with a different file name each time and paste it into the console - this would work but only really as a one off. What I do is I have a list of the image file names and I get the script to open that list and loop through each file and insert each one - again you can do this directly in the console... but that soon gets hard to manage. If you want to do this more often and potentially add more layout / frames / styling etc you will want to save the script (as 'something.py') and execute the script as needed.

cheers

Rob
Title: Re: How to easily add image frame to 100+ pages
Post by: utnik on June 12, 2021, 11:34:07 PM
hi kylar.merrell

if you need this image frame on all the pages in a range (or all odd or even pages), you may create it on the first page of this range, select it and use 'item' → 'duplicate/transform' → 'multiple duplicate' → 'by page' and select your options...

utnik
Title: Re: How to easily add image frame to 100+ pages
Post by: AdmFubar on August 10, 2021, 04:22:43 AM
What version does the "by page" option available?
Title: Re: How to easily add image frame to 100+ pages
Post by: utnik on August 10, 2021, 09:31:14 AM
hi admfubar

Quote from: AdmFubar on August 10, 2021, 04:22:43 AM
What version does the "by page" option available?

i don't know.
the oldest scribus version i have on my system is 1.5.6.1 and there the 'by page' option can be selected. but it might not be possible with scribus 1.4...

utnik
Title: Re: How to easily add image frame to 100+ pages
Post by: WV-Mike on February 21, 2022, 04:22:23 PM
Quote from: utnik on August 10, 2021, 09:31:14 AM
hi admfubar

Quote from: AdmFubar on August 10, 2021, 04:22:43 AM
What version does the "by page" option available?

i don't know.
the oldest scribus version i have on my system is 1.5.6.1 and there the 'by page' option can be selected. but it might not be possible with scribus 1.4...

utnik

I am using Scribus 4.8.7 and I do not see the "by page" option.
I wish to make multiple duplicates of  two images and a text frame.
When I use "duplicate multiple" I am not getting the proper spacing between the duplicates.
I have tries various gap sizes and I can't seem to get it right.
There are some screen shots here:
https://photos.app.goo.gl/GnSDMH3Z8JV8bVW3A

Thanks,
WV-Mike
Title: Re: How to easily add image frame to 100+ pages
Post by: utnik on February 22, 2022, 03:58:00 PM
hi mike

Quote from: WV-Mike on February 21, 2022, 04:22:23 PMI am using Scribus 4.8.7...

what???

Quote...I do not see the "by page" option.
I wish to make multiple duplicates of  two images and a text frame.
When I use "duplicate multiple" I am not getting the proper spacing between the duplicates.
I have tries various gap sizes and I can't seem to get it right.

did you ever try 'by rows & columns'? (the other tab of the 'multiple duplicate' window...)

utnik
Title: Re: How to easily add image frame to 100+ pages
Post by: WV-Mike on February 22, 2022, 05:43:10 PM
Quote from: utnik on February 22, 2022, 03:58:00 PM
hi mike

Quote from: WV-Mike on February 21, 2022, 04:22:23 PMI am using Scribus 4.8.7...

what???
Ooops! - 1.4.8

Quote...I do not see the "by page" option.
I wish to make multiple duplicates of  two images and a text frame.
When I use "duplicate multiple" I am not getting the proper spacing between the duplicates.
I have tries various gap sizes and I can't seem to get it right.

did you ever try 'by rows & columns'? (the other tab of the 'multiple duplicate' window...)

utnik
[/quote]

I have been trying that but no matter what gap size I use the added items do not fit the quides.

Since I only have 26 "panels" I am just going top place everything manually.

Thanks,
WV-Mike