Comments (9)
Some pseudo-code on how to do this from retro-engineering sla 1.4.3 format is below (mix of XPath predicates and procedural)
I'll have to check the 1.5.x format to see if it's similar... and check if I need to do something for the groups update with PAGEOBJECT@GROUPS.
rowscount = data size (or to-from+1 once range is implemented)
pagescount = /SCRIBUSUTF8NEW/DOCUMENT@ANZPAGES
pageheight = /SCRIBUSUTF8NEW/DOCUMENT@PAGEHEIGHT
vgap = /SCRIBUSUTF8NEW/DOCUMENT@GapVertical (40 by default)
groupscount = max(//PAGEOBJECT@NUMGROUP)
for each data row:
voffset = (pageheight+vgap) * row
copy & substitute all /SCRIBUSUTF8NEW/DOCUMENT/PAGE ; @PAGEYPOS += voffset ; @NUM += pagescount
copy & substitute all /SCRIBUSUTF8NEW/DOCUMENT/PAGEOBJECT ; @YPOS += voffset ; @OwnPage += pagescount ; (and @NUMGROUP += groupscount if not 0)
/SCRIBUSUTF8NEW/DOCUMENT@ANZPAGES += (pagescount * rowscount)
from scribusgenerator.
have a single sla generated, instead of many, is now fully working in Scribus 1.4.3 in branch "singleOutput", form command line (SLA only) and GUI (SLA and/or PDF output).
Could you @garydale and @bjarnesvanberg please test and feed back?
from scribusgenerator.
merged in master after satisfactory testing in 1.4.3 and 1.5.1svn Let me know if you find examples that don't work!
from scribusgenerator.
for future reference: to update linked frames (as in bb183cf), add (in the loop):
if version == 1.4*
@NEXTITEM += (objscount * row) if not -1
@BACKITEM += (objscount * row) if not -1
if version == 1.5*
@ItemID += (objscount * row) [modulo max ItemID]
@NEXTITEM += (objscount * row) [modulo max ItemID] if not -1
@BACKITEM += (objscount * row) [modulo max ItemID] if not -1
where objscount = count(.//PAGEOBJECT')
from scribusgenerator.
I've a problem with the single output (Scribus 1.4.6):
- Create a new document with 2 single pages
- Add a variable to one of a page
- Create a csv file containing at least 2 values for the variable
- Create a single SLA or PDF with ScribusGenerator
The result is a wrong SLA/PDF, where the content of the 3rd page starts at the 2nd and so on. Is this a bug? In shiftPagesAndObjects, does voffset has to be multiplied by pagescount?
Kind reagrds
from scribusgenerator.
Hello @StefanWerner23,
The current implementation relies indeed on the number of pages announced in the document layout to compute the position of generated object in merged mode.
So, if you have 2 single pages of content, kindly select a template with 2 pages (like double folded) before calling the script, and switch it back to single page template after the generation.
This was done on purpose to accommodate the way scribus displays multiple pages of a single document easily... but as it is not flexible nor user friendly, if you want to propose a code change that covers your use case more accurately don't hesitate! Otherwise I'll put it on my to-do list, but with no close deadline.
Thanks for the report.
B.
from scribusgenerator.
even less practical with new version of scribus where no 3 or 4 page document can be created easily... double-page seems to be the maximum.
from scribusgenerator.
Hey there @berteh!
This may be closed, if I am not mistaken?
from scribusgenerator.
indeed. thanks.
from scribusgenerator.
Related Issues (20)
- No module named 'scribus'
- Cannot Fetch image from folder HOT 2
- Fetching an image into an image frame in Scribus and export it as a new layer in the generated the PDF file. HOT 3
- [TYPO] in README.md HOT 1
- add support for inline images - add images dynamicaly into a text frame HOT 4
- Clarifications on how `%SG_NEXT-RECORD%` works... HOT 5
- Scribus Generator not working HOT 2
- Colorize Image Effect changes the colour in generated document HOT 1
- --single overlapps pages
- Help wanted. Add Danish and German æ, ø, å and ä, ö HOT 2
- ModuleNotFoundError: No module named 'Tkinter' HOT 6
- How to set my layout as portrait or landscape dynamically HOT 6
- Cannot specify %VAR_logo% using Scribus1.5.8 HOT 1
- s HOT 1
- Is it possible to print %VAR_COUNT%, also noted the duplication of a last entry in .csv HOT 1
- Variable substitution not working when hyphenation is active on text frame HOT 3
- Last row duplicates to fill the remaining placeholders in the template when using SG_NEXT-RECORD HOT 4
- Allow the CLI to generate PDFs HOT 1
- Color not replaced HOT 7
- warn user for variables in template that do not appear in data columns
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scribusgenerator.