This commit is contained in:
2024-09-01 20:52:05 +02:00
parent a40be9a4c7
commit 71f62f910a
5 changed files with 549 additions and 175 deletions

View File

@@ -1,3 +1,30 @@
# inkscape_uprint
Inkscape plugin to create multiple clones of the same object with pattern substitution
## Install
copy the source content into your inkscape extension directory:
${HOME}/.config/inkscape/extensions/inkscape_uprint
or equivalently get it using git clone:
cd ${HOME}/.config/inkscape/extensions/
git clone[https://gitea.mildstone.org/YFinGames/inkscape_uprint.git]()
reload inkscape
find the extension in **Extensions -> Renderg -> InkscapeUprint**
## INSTRUCTIONS:
1. Create any shape with text wherever you like;
place text elements in a frame as much as possible ( multiline substitution works in framed text only )
2. place {{tags}} where you like, each tag is eventually searched in the first line of the xlsx file ( the header ) and a set of replicas of the selection will be generatend in a separate page, one for each line of the xlsx. Any keyword can be used as a tag and it will be substituted unless wrapped between double curly braces.
3. apply any transform to the shape lou like
4. group anything together but do not apply any transform to the group afterwards. If you need to ungroup make what you like ( translate, rotate, scale ) and then regroup everything together. The changes applied to the toplevel group are affecting the position of the shape after the placement on the output pages.
5. Select the group and apply InkscapeUprint. The parameters are:
- padding: padding space among placed shapes
- page margins: From the page to the page collection
- The size of the output pages is copied from the model one

385
example.svg Normal file
View File

@@ -0,0 +1,385 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="210mm"
height="297mm"
viewBox="0 0 210 297"
version="1.1"
id="svg1"
sodipodi:docname="example.svg"
inkscape:version="1.3.2 (091e20ef0f, 2023-11-25, custom)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
id="namedview1"
pagecolor="#ffffff"
bordercolor="#000000"
borderopacity="0.25"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:document-units="mm"
inkscape:zoom="1.3001718"
inkscape:cx="481.47485"
inkscape:cy="343.0316"
inkscape:window-width="1366"
inkscape:window-height="709"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="layer1" />
<defs
id="defs1">
<rect
x="60.476995"
y="368.08839"
width="238.18091"
height="55.721765"
id="rect2" />
<rect
x="60.476995"
y="366.0514"
width="238.18091"
height="57.758755"
id="rect1" />
<filter
style="color-interpolation-filters:sRGB"
inkscape:label="Drop Shadow"
id="filter414"
x="-0.060531211"
y="-0.061268377"
width="1.1378766"
height="1.1735937">
<feFlood
result="flood"
in="SourceGraphic"
flood-opacity="0.815686"
flood-color="rgb(0,0,0)"
id="feFlood413" />
<feGaussianBlur
result="blur"
in="SourceGraphic"
stdDeviation="0.300000"
id="feGaussianBlur413" />
<feOffset
result="offset"
in="blur"
dx="0.200000"
dy="0.600000"
id="feOffset413" />
<feComposite
result="comp1"
operator="in"
in="flood"
in2="offset"
id="feComposite413" />
<feComposite
result="comp2"
operator="over"
in="SourceGraphic"
in2="comp1"
id="feComposite414" />
</filter>
<filter
style="color-interpolation-filters:sRGB"
inkscape:label="Drop Shadow"
id="filter2"
x="-0.06053121"
y="-0.061268378"
width="1.1378766"
height="1.1735938">
<feFlood
result="flood"
in="SourceGraphic"
flood-opacity="0.815686"
flood-color="rgb(0,0,0)"
id="feFlood1" />
<feGaussianBlur
result="blur"
in="SourceGraphic"
stdDeviation="0.300000"
id="feGaussianBlur1" />
<feOffset
result="offset"
in="blur"
dx="0.200000"
dy="0.600000"
id="feOffset1" />
<feComposite
result="comp1"
operator="in"
in="flood"
in2="offset"
id="feComposite1" />
<feComposite
result="comp2"
operator="over"
in="SourceGraphic"
in2="comp1"
id="feComposite2" />
</filter>
<rect
x="381.91656"
y="92.793617"
width="378.68661"
height="413.95236"
id="rect1178" />
<rect
x="60.476995"
y="368.08839"
width="238.18091"
height="55.721765"
id="rect7" />
</defs>
<g
inkscape:label="Livello 1"
inkscape:groupmode="layer"
id="layer1">
<text
xml:space="preserve"
style="font-weight:bold;font-size:11.3234px;line-height:normal;font-family:'Droid Sans';-inkscape-font-specification:'Droid Sans Bold';text-align:start;text-decoration-color:#000000;text-anchor:start;fill:#003380;fill-opacity:0.992157;stroke-width:2.83085"
x="56.601398"
y="37.344131"
id="text918"><tspan
sodipodi:role="line"
id="tspan918"
style="text-align:start;text-anchor:start;fill:#003380;stroke-width:2.83085"
x="56.601398"
y="37.344131">InkscapeUprint</tspan></text>
<g
id="g8">
<rect
style="fill:#f2f2f2;fill-opacity:0.992157;stroke-width:0.79375"
id="rect1177"
width="104.48315"
height="96.203575"
x="93.674995"
y="64.031319" />
<text
xml:space="preserve"
id="text1177"
style="font-weight:bold;font-size:12px;line-height:normal;font-family:'Droid Sans';-inkscape-font-specification:'Droid Sans Bold';text-align:start;text-decoration-color:#000000;white-space:pre;shape-inside:url(#rect1178);shape-padding:5.82846;display:inline;fill:#1a1a1a;fill-opacity:0.992157;stroke-width:3"
x="-179.4873"
y="0"
transform="matrix(0.26458333,0,0,0.26458333,-2.8006266,39.479475)"><tspan
x="387.74414"
y="112.79788"
id="tspan8"><tspan
style="font-size:16px"
id="tspan3">INSTRUCTIONS</tspan>:
</tspan><tspan
x="387.74414"
y="129.25368"
id="tspan9">
</tspan><tspan
x="387.74414"
y="144.25368"
id="tspan10">1. Create any shape with text whwere you like, put text in a </tspan><tspan
x="387.74414"
y="159.25368"
id="tspan11">frame as much as possible ( multiline substitution works in </tspan><tspan
x="387.74414"
y="174.25368"
id="tspan12">framed text only )
</tspan><tspan
x="387.74414"
y="189.25368"
id="tspan13">
</tspan><tspan
x="387.74414"
y="204.25368"
id="tspan14">2. place {{tags}} where you like in the text
</tspan><tspan
x="387.74414"
y="219.25368"
id="tspan15">
</tspan><tspan
x="387.74414"
y="234.25368"
id="tspan16">3. apply any transform to the shape
</tspan><tspan
x="387.74414"
y="249.25368"
id="tspan17">
</tspan><tspan
x="387.74414"
y="264.25368"
id="tspan18">4. group anything together but do not apply any transform to </tspan><tspan
x="387.74414"
y="279.25368"
id="tspan19">the group afterwards. If you need to ungroup make what you </tspan><tspan
x="387.74414"
y="294.25368"
id="tspan20">like ( translate, rotate, scale ) and then regroup everything </tspan><tspan
x="387.74414"
y="309.25368"
id="tspan21">together. The changes applied to the toplevel group are </tspan><tspan
x="387.74414"
y="324.25368"
id="tspan22">affecting the position of the shape after the placement on the </tspan><tspan
x="387.74414"
y="339.25368"
id="tspan23">output pages.
</tspan><tspan
x="387.74414"
y="354.25368"
id="tspan24">
</tspan><tspan
x="387.74414"
y="369.25368"
id="tspan25">5. Select the group and apply InkscapeUprint. The parameters </tspan><tspan
x="387.74414"
y="384.25368"
id="tspan26">are:
</tspan><tspan
x="387.74414"
y="399.25368"
id="tspan27"> padding: padding space among placed shapes
</tspan><tspan
x="387.74414"
y="414.25368"
id="tspan28"> page margins: From the page to the page collection
</tspan><tspan
x="387.74414"
y="429.25368"
id="tspan29"> The size of the output pages is copied from the model one
</tspan></text>
</g>
<text
xml:space="preserve"
transform="scale(0.26458333)"
id="text1"
style="fill:#003380;-inkscape-font-specification:'URW Gothic';font-family:'URW Gothic';stroke-width:3;font-size:10.66666667px;line-height:normal;text-decoration-color:#000000;fill-opacity:0.99000001;white-space:pre;shape-inside:url(#rect1)" />
<g
id="g2">
<rect
style="fill:#a90000;fill-opacity:0.992157;stroke-width:0.79375"
id="rect894"
width="77.67379"
height="48.101791"
x="16.001205"
y="64.031319" />
<rect
style="fill:#f9f9f9;fill-opacity:0.99;stroke-width:0.479651"
id="rect913"
width="63.0187"
height="39.026112"
x="16.001205"
y="73.106995"
ry="0" />
<text
xml:space="preserve"
style="font-size:5.19872px;line-height:normal;font-family:Helvetica;-inkscape-font-specification:Helvetica;text-align:center;text-decoration-color:#000000;text-anchor:middle;fill:#1a1a1a;fill-opacity:0.99;stroke-width:0.899777"
x="48.434498"
y="85.615204"
id="text915"><tspan
sodipodi:role="line"
style="font-size:7.19821px;fill:#1a1a1a;stroke-width:0.899777"
x="48.434498"
y="85.615204"
id="tspan914">{{nome}}</tspan><tspan
sodipodi:role="line"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:5.19872px;font-family:'Droid Sans';-inkscape-font-specification:'Droid Sans Bold';fill:#1a1a1a;stroke-width:0.899777"
x="48.434498"
y="93.072014"
id="tspan915">{{cognome}}</tspan></text>
<text
xml:space="preserve"
style="font-size:7.4238px;line-height:normal;font-family:Helvetica;-inkscape-font-specification:Helvetica;text-align:center;text-decoration-color:#000000;text-anchor:middle;fill:#ffffff;fill-opacity:0.99;stroke-width:0.759254"
x="-88.101959"
y="88.750298"
id="text916"
transform="rotate(-90)"><tspan
sodipodi:role="line"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:7.4238px;font-family:'Droid Sans';-inkscape-font-specification:'Droid Sans Bold';fill:#ffffff;stroke-width:0.759254"
x="-88.101959"
y="88.750298"
id="tspan916">{{ruolo}}</tspan></text>
<path
id="path916"
style="fill:#e6e6e6;filter:url(#filter414)"
d="m 100.53906,50.353516 c -1.111684,0.134501 -1.683061,1.246294 -2.472178,1.913403 -0.982007,1.072679 -2.114732,2.022467 -2.982898,3.190112 -0.498647,0.684812 -0.08422,1.670251 0.729634,1.84217 0.423512,0.178196 1.041103,0.119572 0.418804,0.548455 -0.407836,0.764147 0.599986,1.165055 1.178152,1.325992 0.03629,0.139322 -0.611848,0.518583 -0.391043,0.922055 0.09111,0.610063 0.8575,0.927441 1.390625,0.65625 0.274787,0.386465 0.847553,0.277835 1.16211,0.533203 0.205046,0.996978 1.441944,0.915528 2.171874,0.59375 0.5556,-0.178658 1.3848,-0.644629 0.99024,-1.333984 -0.18654,-0.246169 0.56389,-0.242038 0.75,-0.353516 0.24451,0.118859 0.54075,0.655884 0.99837,0.521984 0.48071,0.04677 0.9052,-0.42568 0.81803,-0.848156 0.60402,0.07023 1.47945,-0.474745 1.01563,-1.128906 -0.44281,-0.725971 -1.57628,-0.808549 -2.12305,-0.207031 -0.72293,-0.361206 0.42123,-0.380257 0.66907,-0.571727 0.88063,-0.275896 2.10837,-0.851657 1.86999,-1.977101 -0.44823,-1.052442 -1.49937,-1.68815 -2.20801,-2.556445 -0.98911,-0.953669 -1.86761,-2.045782 -2.95996,-2.879102 -0.31258,-0.166294 -0.67437,-0.224838 -1.02539,-0.191406 z"
transform="matrix(1.13358,0,0,1.13358,-90.499861,9.036843)" />
<path
style="fill:#000000;stroke-width:1.13358"
d="m 23.296091,78.793105 c -0.161807,-0.0598 -0.248775,-0.16401 -0.309784,-0.37115 -0.06643,-0.22567 -0.165638,-0.38249 -0.299854,-0.47414 -0.127573,-0.0871 -0.265643,-0.13225 -0.606669,-0.19833 -0.309813,-0.06 -0.524309,-0.15829 -0.593598,-0.27193 -0.09464,-0.15523 -0.04784,-0.26496 0.250947,-0.58826 0.227049,-0.24567 0.279239,-0.32825 0.279239,-0.4418 0,-0.19132 -0.387932,-0.39335 -1.395849,-0.72694 -0.84359,-0.2792 -1.156077,-0.40056 -1.343692,-0.52182 -0.17453,-0.1128 -0.212003,-0.17003 -0.172994,-0.26421 0.0396,-0.0956 0.11194,-0.14182 0.622295,-0.39759 0.465364,-0.23323 0.58153,-0.31936 0.58153,-0.43117 0,-0.0295 -0.01354,-0.0713 -0.03009,-0.0927 -0.04336,-0.0562 -0.545391,-0.21743 -0.992735,-0.31886 -0.995832,-0.22581 -1.368963,-0.38153 -1.544885,-0.64477 -0.138565,-0.20733 -0.130638,-0.4296 0.0269,-0.75417 0.176051,-0.36272 0.111895,-0.29415 3.813687,-4.07648 0.602386,-0.61549 1.149938,-1.1613 1.216785,-1.2129 0.407986,-0.31496 1.006334,-0.38933 1.474695,-0.18329 0.293211,0.12899 0.345753,0.17942 2.798442,2.68618 1.335253,1.36469 2.482843,2.54514 2.550188,2.62322 0.06733,0.0781 0.162737,0.22263 0.211968,0.32122 0.08241,0.16492 0.08955,0.19569 0.08955,0.38506 0,0.18322 -0.0079,0.21998 -0.07153,0.3349 -0.138342,0.24977 -0.450937,0.48671 -0.950279,0.72031 -0.282748,0.13227 -0.501268,0.21224 -1.360792,0.49801 -0.8807,0.29281 -1.219198,0.42876 -1.320982,0.53054 -0.06076,0.0607 -0.0475,0.16804 0.03174,0.25829 0.03877,0.0441 0.214734,0.15979 0.391074,0.25703 0.514565,0.28372 0.645527,0.40083 0.645527,0.57724 0,0.11121 -0.112451,0.33196 -0.227815,0.44735 -0.136347,0.13635 -0.308005,0.21428 -0.662645,0.30083 -0.535423,0.13067 -0.715673,0.20179 -1.010777,0.39883 -0.176521,0.11787 -0.396333,0.33287 -0.419379,0.41022 -0.02188,0.0735 0.0806,0.18553 0.237689,0.25985 0.266277,0.12597 0.334439,0.2359 0.223802,0.36096 -0.142411,0.16098 -0.703079,0.42612 -1.177266,0.55674 -0.292679,0.0806 -0.792655,0.10352 -0.954405,0.0437 z m 0.610965,-3.78863 c 0.112224,-0.0772 0.162737,-0.18102 0.105309,-0.21648 -0.01757,-0.0109 -0.162589,-0.0436 -0.32214,-0.0726 -0.449996,-0.082 -1.589129,-0.32505 -1.855475,-0.39598 -0.29259,-0.0779 -0.332305,-0.082 -0.341828,-0.0354 -0.02345,0.1149 1.087133,0.57762 1.762814,0.73446 0.132357,0.0307 0.309104,0.0566 0.392751,0.0575 0.131608,0.002 0.166432,-0.008 0.258512,-0.0715 z m 0.02029,-4.80043 0.590379,-0.37324 0.371689,0.19373 0.3717,0.19373 0.01372,-0.0672 c 0.0079,-0.0369 0.04704,-0.26719 0.08762,-0.51167 0.04058,-0.24448 0.0781,-0.44869 0.0832,-0.45381 0.0045,-0.005 0.205291,0.14924 0.444827,0.34302 l 0.435544,0.35233 0.03525,-0.0843 c 0.04557,-0.10905 0.04455,-0.21823 -0.0034,-0.35868 -0.03333,-0.098 -0.171544,-0.24681 -1.040874,-1.1213 -1.100149,-1.10668 -1.094946,-1.10249 -1.441356,-1.16114 -0.138229,-0.0234 -0.205404,-0.0233 -0.324895,4.6e-4 -0.312459,0.0621 -0.385553,0.11635 -1.082102,0.8026 -0.842442,0.82998 -1.317119,1.33406 -1.400474,1.48721 -0.128478,0.23605 -0.109118,0.47594 0.0484,0.59985 0.06063,0.0477 0.09245,0.0503 0.623255,0.0503 h 0.559367 l 0.308708,-0.54171 c 0.179899,-0.31567 0.31527,-0.52907 0.32443,-0.51141 0.0091,0.0167 0.09976,0.36873 0.202548,0.78237 0.102702,0.41364 0.190248,0.75207 0.194397,0.75207 0.0045,0 0.273238,-0.16796 0.597951,-0.37324 z m -3.469936,7.20442 c -0.111148,-0.0196 -0.193976,-0.0702 -0.303544,-0.18554 -0.0518,-0.0545 -0.07253,-0.1037 -0.08104,-0.19221 -0.01077,-0.11253 -0.0061,-0.12473 0.08772,-0.2265 0.203636,-0.22091 0.662325,-0.34121 0.977444,-0.25634 0.125356,0.0338 0.276763,0.13767 0.276763,0.18994 0,0.0226 -0.04154,0.10508 -0.09233,0.18324 -0.220451,0.33932 -0.574189,0.53864 -0.865015,0.48742 z m 7.187121,-0.19266 c -0.09828,-0.057 -0.189126,-0.19874 -0.189126,-0.29507 0,-0.0862 0.05124,-0.20231 0.130803,-0.29671 0.07255,-0.086 0.100435,-0.0864 0.294436,-0.004 0.214393,0.0911 0.41778,0.3532 0.382662,0.49309 -0.03662,0.14576 -0.431474,0.21127 -0.618775,0.10267 z m 0.869783,-0.92714 c -0.288552,-0.0298 -0.586751,-0.11695 -0.629929,-0.18398 -0.04908,-0.0763 0.251121,-0.41269 0.443399,-0.49688 0.265688,-0.11633 0.573205,-0.11268 0.822808,0.01 0.132764,0.0651 0.334666,0.25041 0.390574,0.35844 0.0314,0.0606 0.03083,0.0746 -0.0045,0.1286 -0.09749,0.14871 -0.559637,0.23193 -1.022363,0.18406 z"
id="path917" />
<text
xml:space="preserve"
transform="scale(0.26458333)"
id="text2"
style="font-size:10.6667px;line-height:normal;font-family:'URW Gothic';-inkscape-font-specification:'URW Gothic';text-align:center;text-decoration-color:#000000;white-space:pre;shape-inside:url(#rect2);shape-padding:8.48145;fill:#1a1a1a;fill-opacity:0.99;stroke-width:3"><tspan
x="145.1246"
y="385.78634"
id="tspan30">{{affiliazione}}</tspan></text>
</g>
<g
id="g7"
transform="translate(0,48.101781)">
<rect
style="fill:#003280;fill-opacity:0.99215686;stroke-width:0.79375"
id="rect3"
width="77.67379"
height="48.101791"
x="16.001205"
y="64.031319" />
<rect
style="fill:#f9f9f9;fill-opacity:0.99;stroke-width:0.479651"
id="rect4"
width="63.0187"
height="39.026112"
x="16.001205"
y="73.106995"
ry="0" />
<text
xml:space="preserve"
style="font-size:5.19872px;line-height:normal;font-family:Helvetica;-inkscape-font-specification:Helvetica;text-align:center;text-decoration-color:#000000;text-anchor:middle;fill:#1a1a1a;fill-opacity:0.99;stroke-width:0.899777"
x="48.434498"
y="85.615204"
id="text5"><tspan
sodipodi:role="line"
style="font-size:7.19821px;fill:#1a1a1a;stroke-width:0.899777"
x="48.434498"
y="85.615204"
id="tspan4">{{nome}}</tspan><tspan
sodipodi:role="line"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:5.19872px;font-family:'Droid Sans';-inkscape-font-specification:'Droid Sans Bold';fill:#1a1a1a;stroke-width:0.899777"
x="48.434498"
y="93.072014"
id="tspan5">{{cognome}}</tspan></text>
<text
xml:space="preserve"
style="font-size:7.4238px;line-height:normal;font-family:Helvetica;-inkscape-font-specification:Helvetica;text-align:center;text-decoration-color:#000000;text-anchor:middle;fill:#ffffff;fill-opacity:0.99;stroke-width:0.759254"
x="-88.101959"
y="88.750298"
id="text6"
transform="rotate(-90)"><tspan
sodipodi:role="line"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:7.4238px;font-family:'Droid Sans';-inkscape-font-specification:'Droid Sans Bold';fill:#ffffff;stroke-width:0.759254"
x="-88.101959"
y="88.750298"
id="tspan6">{{ruolo}}</tspan></text>
<path
id="path6"
style="fill:#e6e6e6;filter:url(#filter414)"
d="m 100.53906,50.353516 c -1.111684,0.134501 -1.683061,1.246294 -2.472178,1.913403 -0.982007,1.072679 -2.114732,2.022467 -2.982898,3.190112 -0.498647,0.684812 -0.08422,1.670251 0.729634,1.84217 0.423512,0.178196 1.041103,0.119572 0.418804,0.548455 -0.407836,0.764147 0.599986,1.165055 1.178152,1.325992 0.03629,0.139322 -0.611848,0.518583 -0.391043,0.922055 0.09111,0.610063 0.8575,0.927441 1.390625,0.65625 0.274787,0.386465 0.847553,0.277835 1.16211,0.533203 0.205046,0.996978 1.441944,0.915528 2.171874,0.59375 0.5556,-0.178658 1.3848,-0.644629 0.99024,-1.333984 -0.18654,-0.246169 0.56389,-0.242038 0.75,-0.353516 0.24451,0.118859 0.54075,0.655884 0.99837,0.521984 0.48071,0.04677 0.9052,-0.42568 0.81803,-0.848156 0.60402,0.07023 1.47945,-0.474745 1.01563,-1.128906 -0.44281,-0.725971 -1.57628,-0.808549 -2.12305,-0.207031 -0.72293,-0.361206 0.42123,-0.380257 0.66907,-0.571727 0.88063,-0.275896 2.10837,-0.851657 1.86999,-1.977101 -0.44823,-1.052442 -1.49937,-1.68815 -2.20801,-2.556445 -0.98911,-0.953669 -1.86761,-2.045782 -2.95996,-2.879102 -0.31258,-0.166294 -0.67437,-0.224838 -1.02539,-0.191406 z"
transform="matrix(1.13358,0,0,1.13358,-90.499861,9.036843)" />
<path
style="fill:#000000;stroke-width:1.13358"
d="m 23.296091,78.793105 c -0.161807,-0.0598 -0.248775,-0.16401 -0.309784,-0.37115 -0.06643,-0.22567 -0.165638,-0.38249 -0.299854,-0.47414 -0.127573,-0.0871 -0.265643,-0.13225 -0.606669,-0.19833 -0.309813,-0.06 -0.524309,-0.15829 -0.593598,-0.27193 -0.09464,-0.15523 -0.04784,-0.26496 0.250947,-0.58826 0.227049,-0.24567 0.279239,-0.32825 0.279239,-0.4418 0,-0.19132 -0.387932,-0.39335 -1.395849,-0.72694 -0.84359,-0.2792 -1.156077,-0.40056 -1.343692,-0.52182 -0.17453,-0.1128 -0.212003,-0.17003 -0.172994,-0.26421 0.0396,-0.0956 0.11194,-0.14182 0.622295,-0.39759 0.465364,-0.23323 0.58153,-0.31936 0.58153,-0.43117 0,-0.0295 -0.01354,-0.0713 -0.03009,-0.0927 -0.04336,-0.0562 -0.545391,-0.21743 -0.992735,-0.31886 -0.995832,-0.22581 -1.368963,-0.38153 -1.544885,-0.64477 -0.138565,-0.20733 -0.130638,-0.4296 0.0269,-0.75417 0.176051,-0.36272 0.111895,-0.29415 3.813687,-4.07648 0.602386,-0.61549 1.149938,-1.1613 1.216785,-1.2129 0.407986,-0.31496 1.006334,-0.38933 1.474695,-0.18329 0.293211,0.12899 0.345753,0.17942 2.798442,2.68618 1.335253,1.36469 2.482843,2.54514 2.550188,2.62322 0.06733,0.0781 0.162737,0.22263 0.211968,0.32122 0.08241,0.16492 0.08955,0.19569 0.08955,0.38506 0,0.18322 -0.0079,0.21998 -0.07153,0.3349 -0.138342,0.24977 -0.450937,0.48671 -0.950279,0.72031 -0.282748,0.13227 -0.501268,0.21224 -1.360792,0.49801 -0.8807,0.29281 -1.219198,0.42876 -1.320982,0.53054 -0.06076,0.0607 -0.0475,0.16804 0.03174,0.25829 0.03877,0.0441 0.214734,0.15979 0.391074,0.25703 0.514565,0.28372 0.645527,0.40083 0.645527,0.57724 0,0.11121 -0.112451,0.33196 -0.227815,0.44735 -0.136347,0.13635 -0.308005,0.21428 -0.662645,0.30083 -0.535423,0.13067 -0.715673,0.20179 -1.010777,0.39883 -0.176521,0.11787 -0.396333,0.33287 -0.419379,0.41022 -0.02188,0.0735 0.0806,0.18553 0.237689,0.25985 0.266277,0.12597 0.334439,0.2359 0.223802,0.36096 -0.142411,0.16098 -0.703079,0.42612 -1.177266,0.55674 -0.292679,0.0806 -0.792655,0.10352 -0.954405,0.0437 z m 0.610965,-3.78863 c 0.112224,-0.0772 0.162737,-0.18102 0.105309,-0.21648 -0.01757,-0.0109 -0.162589,-0.0436 -0.32214,-0.0726 -0.449996,-0.082 -1.589129,-0.32505 -1.855475,-0.39598 -0.29259,-0.0779 -0.332305,-0.082 -0.341828,-0.0354 -0.02345,0.1149 1.087133,0.57762 1.762814,0.73446 0.132357,0.0307 0.309104,0.0566 0.392751,0.0575 0.131608,0.002 0.166432,-0.008 0.258512,-0.0715 z m 0.02029,-4.80043 0.590379,-0.37324 0.371689,0.19373 0.3717,0.19373 0.01372,-0.0672 c 0.0079,-0.0369 0.04704,-0.26719 0.08762,-0.51167 0.04058,-0.24448 0.0781,-0.44869 0.0832,-0.45381 0.0045,-0.005 0.205291,0.14924 0.444827,0.34302 l 0.435544,0.35233 0.03525,-0.0843 c 0.04557,-0.10905 0.04455,-0.21823 -0.0034,-0.35868 -0.03333,-0.098 -0.171544,-0.24681 -1.040874,-1.1213 -1.100149,-1.10668 -1.094946,-1.10249 -1.441356,-1.16114 -0.138229,-0.0234 -0.205404,-0.0233 -0.324895,4.6e-4 -0.312459,0.0621 -0.385553,0.11635 -1.082102,0.8026 -0.842442,0.82998 -1.317119,1.33406 -1.400474,1.48721 -0.128478,0.23605 -0.109118,0.47594 0.0484,0.59985 0.06063,0.0477 0.09245,0.0503 0.623255,0.0503 h 0.559367 l 0.308708,-0.54171 c 0.179899,-0.31567 0.31527,-0.52907 0.32443,-0.51141 0.0091,0.0167 0.09976,0.36873 0.202548,0.78237 0.102702,0.41364 0.190248,0.75207 0.194397,0.75207 0.0045,0 0.273238,-0.16796 0.597951,-0.37324 z m -3.469936,7.20442 c -0.111148,-0.0196 -0.193976,-0.0702 -0.303544,-0.18554 -0.0518,-0.0545 -0.07253,-0.1037 -0.08104,-0.19221 -0.01077,-0.11253 -0.0061,-0.12473 0.08772,-0.2265 0.203636,-0.22091 0.662325,-0.34121 0.977444,-0.25634 0.125356,0.0338 0.276763,0.13767 0.276763,0.18994 0,0.0226 -0.04154,0.10508 -0.09233,0.18324 -0.220451,0.33932 -0.574189,0.53864 -0.865015,0.48742 z m 7.187121,-0.19266 c -0.09828,-0.057 -0.189126,-0.19874 -0.189126,-0.29507 0,-0.0862 0.05124,-0.20231 0.130803,-0.29671 0.07255,-0.086 0.100435,-0.0864 0.294436,-0.004 0.214393,0.0911 0.41778,0.3532 0.382662,0.49309 -0.03662,0.14576 -0.431474,0.21127 -0.618775,0.10267 z m 0.869783,-0.92714 c -0.288552,-0.0298 -0.586751,-0.11695 -0.629929,-0.18398 -0.04908,-0.0763 0.251121,-0.41269 0.443399,-0.49688 0.265688,-0.11633 0.573205,-0.11268 0.822808,0.01 0.132764,0.0651 0.334666,0.25041 0.390574,0.35844 0.0314,0.0606 0.03083,0.0746 -0.0045,0.1286 -0.09749,0.14871 -0.559637,0.23193 -1.022363,0.18406 z"
id="path7" />
<text
xml:space="preserve"
transform="scale(0.26458333)"
id="text7"
style="font-size:10.6667px;line-height:normal;font-family:'URW Gothic';-inkscape-font-specification:'URW Gothic';text-align:center;text-decoration-color:#000000;white-space:pre;shape-inside:url(#rect7);shape-padding:8.48145;fill:#1a1a1a;fill-opacity:0.99;stroke-width:3"><tspan
x="145.1246"
y="385.78634"
id="tspan31">{{affiliazione}}</tspan></text>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

View File

@@ -7,79 +7,35 @@
<page name="general_settings" gui-text="General">
<label appearance="header">InkstapeUprint - By YFin Games</label>
<param name="subst_file" type="path" mode="file" filetypes="xlsx" gui-text="Substitutions file:"></param>
<param name="x" type="float" min="-1000" max="10000" precision="3" gui-text="Center X:">0</param>
<param name="y" type="float" min="-1000" max="10000" precision="3" gui-text="Center Y:">0</param>
<!-- <param name="x" type="float" min="-1000" max="10000" precision="3" gui-text="Center X:">0</param>
<param name="y" type="float" min="-1000" max="10000" precision="3" gui-text="Center Y:">0</param> -->
<param name="element_padding" type="float" min="-100" max="100" precision="2" gui-text="padding:" >2</param>
<param name="units" type="optiongroup" gui-text="Units" appearance="combo">
<item value="px">px</item>
<item value="mm">mm</item>
</param>
</page>
<!-- <page name="cal_settings" gui-text="Calendar">
<param name="font_family" type="string" gui-text="Font family:">Apple Garamond</param>
<param name="year" type="int" min="1970" max="3000" gui-text="Year:">1970</param>
<param name="month" type="optiongroup" gui-text="Month" appearance="combo">
<item value="Gennaio">Gennaio</item>
<item value="Febbraio">Febbraio</item>
<item value="Marzo">Marzo</item>
<item value="Aprile">Aprile</item>
<item value="Maggio">Maggio</item>
<item value="Giugno">Giugno</item>
<item value="Luglio">Luglio</item>
<item value="Agosto">Agosto</item>
<item value="Settembre">Settembre</item>
<item value="Ottobre">Ottobre</item>
<item value="Novembre">Novembre</item>
<item value="Dicembre">Dicembre</item>
</param>
<param name="dayfrom" type="int" min="1" max="31" gui-text="Day range from:">1</param>
<param name="dayto" type="int" min="1" max="31" gui-text="Day range to:">31</param>
<param name="linewidth" type="float" min="0" max="100" precision="2" gui-text="HLine width:">1</param>
<param name="columnwidth" type="float" min="0" max="10000" precision="2" gui-text="Column width:">500</param>
<param name="rowheight" type="float" min="1" max="10000" precision="2" gui-text="Row height:" >12</param>
</page>
<page name="spacing" gui-text="Spacing">
<separator/>
<label appearance="header">Day</label>
<param name="day_size" type="float" min="1" max="100" precision="2" gui-text="text size:" >16</param>
<param name="day_padding" type="float" min="-100" max="100" precision="2" gui-text="padding:" >10</param>
<param name="day_margin_top" type="float" min="-100" max="100" precision="2" gui-text="margin top:" >0</param>
<param name="day_margin_bottom" type="float" min="-100" max="100" precision="2" gui-text="margin bottom:">0</param>
<param name="day_margin_left" type="float" min="-100" max="100" precision="2" gui-text="margin left:" >0</param>
<param name="day_margin_right" type="float" min="-100" max="100" precision="2" gui-text="margin right:" >0</param>
<!-- <separator/>
<label appearance="header">Elements spacing</label>
<param name="element_size" type="float" min="1" max="100" precision="2" gui-text="text size:" >0</param>
<param name="element_padding" type="float" min="-100" max="100" precision="2" gui-text="padding:" >2</param>
<param name="element_margin_top" type="float" min="-100" max="100" precision="2" gui-text="margin top:" >0</param>
<param name="element_margin_bottom" type="float" min="-100" max="100" precision="2" gui-text="margin bottom:">0</param>
<param name="element_margin_left" type="float" min="-100" max="100" precision="2" gui-text="margin left:" >0</param>
<param name="element_margin_right" type="float" min="-100" max="100" precision="2" gui-text="margin right:" >0</param> -->
<separator/>
<label appearance="header">Week Day</label>
<param name="wday_size" type="float" min="1" max="100" precision="2" gui-text="text size:" >14</param>
<param name="wday_padding" type="float" min="-100" max="100" precision="2" gui-text="padding:" >0</param>
<param name="wday_margin_top" type="float" min="-100" max="100" precision="2" gui-text="margin top:" >0</param>
<param name="wday_margin_bottom" type="float" min="-100" max="100" precision="2" gui-text="margin bottom:">0</param>
<param name="wday_margin_left" type="float" min="-100" max="100" precision="2" gui-text="margin left:" >0</param>
<param name="wday_margin_right" type="float" min="-100" max="100" precision="2" gui-text="margin right:" >0</param>
<label appearance="header">Page Spacing</label>
<!-- <param name="page_size" type="float" min="1" max="100" precision="2" gui-text="text size:" >0</param> -->
<param name="page_padding" type="float" min="-100" max="100" precision="2" gui-text="page to page:" >10</param>
<param name="page_margin_top" type="float" min="-100" max="100" precision="2" gui-text="margin top:" >0</param>
<param name="page_margin_bottom" type="float" min="-100" max="100" precision="2" gui-text="margin bottom:">0</param>
<param name="page_margin_left" type="float" min="-100" max="100" precision="2" gui-text="margin left:" >0</param>
<param name="page_margin_right" type="float" min="-100" max="100" precision="2" gui-text="margin right:" >0</param>
</page>
<page name="spacing2" gui-text="Spacing 2">
<separator/>
<label appearance="header">Saint label</label>
<param name="saint_size" type="float" min="1" max="100" precision="2" gui-text="text size:" >9</param>
<param name="saint_padding" type="float" min="-100" max="100" precision="2" gui-text="padding:" >0</param>
<param name="saint_margin_top" type="float" min="-100" max="100" precision="2" gui-text="margin top:" >0</param>
<param name="saint_margin_bottom" type="float" min="-100" max="100" precision="2" gui-text="margin bottom:">0</param>
<param name="saint_margin_left" type="float" min="-100" max="100" precision="2" gui-text="margin left:" >0</param>
<param name="saint_margin_right" type="float" min="-100" max="100" precision="2" gui-text="margin right:" >0</param>
<separator/>
<label appearance="header">Moon phase</label>
<param name="moon_size" type="float" min="1" max="100" precision="2" gui-text="moon size:" >21</param>
<param name="moon_padding" type="float" min="-100" max="100" precision="2" gui-text="padding:" >0</param>
<param name="moon_margin_top" type="float" min="-100" max="100" precision="2" gui-text="margin top:" >0</param>
<param name="moon_margin_bottom" type="float" min="-100" max="100" precision="2" gui-text="margin bottom:">0</param>
<param name="moon_margin_left" type="float" min="-100" max="100" precision="2" gui-text="margin left:" >0</param>
<param name="moon_margin_right" type="float" min="-100" max="100" precision="2" gui-text="margin right:" >0</param>
</page>
-->
</param>
<effect>

View File

@@ -37,6 +37,7 @@ dec = decimal.Decimal
# ['NAMESPACE', 'PARSER', 'TAG', 'WRAPPED_ATTRS', '__abstractmethods__', '__bool__',
# '__class__', '__contains__', '__copy__', '__deepcopy__', '__delattr__', '__delitem__',
# '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattr__',
@@ -71,13 +72,16 @@ dec = decimal.Decimal
# |_| |_|
class _Spacing():
size = 0.
padding = 0.
margin_top = 0.
margin_bottom = 0.
margin_left = 0.
margin_right = 0.
# class _Spacing():
# size = 0.
# padding = 0.
# margin_top = 0.
# margin_bottom = 0.
# margin_left = 0.
# margin_right = 0.
class InkscapeUprint(inkex.Effect):
def __init__(self):
@@ -105,79 +109,54 @@ class InkscapeUprint(inkex.Effect):
type=str,
dest="subst_file", default='',
help="xlsx file to load substitutions")
# self.arg_parser.add_argument("--font_family",
# type=str,
# dest="font_family", default="Apple Garamond",
# help="Font family to use for days and labels")
# self.arg_parser.add_argument("--year",
# type=int,
# dest="year", default=1970,
# help="Calendar Year")
# self.arg_parser.add_argument("-m", "--month",
# type=str,
# dest="month", default="Gennaio",
# help="month to render")
# self.arg_parser.add_argument("--dayfrom",
# type=int,
# dest="dayfrom", default=1,
# help="Range to render day from")
# self.arg_parser.add_argument("--dayto",
# type=int,
# dest="dayto", default=31,
# help="Range to render day to")
# self.arg_parser.add_argument("--day_text_size",
# type=float,
# dest="day_text_size", default=12,
# help="Text size of day")
# self.arg_parser.add_argument("--saint_text_size",
# type=float,
# dest="saint_text_size", default=8,
# help="Text size of saint")
# spacing
# self.__elements = ['day', 'wday', 'saint', 'moon']
self.__element_spacing = {
'size' : 0,
'padding' : 0,
'margin-top' : 5,
'margin-bottom' : 5,
'margin-left' : 5,
'margin-right' : 5
'margin-top' : 0,
'margin-bottom' : 0,
'margin-left' : 0,
'margin-right' : 0
}
self.__page_spacing = {
'size' : 0,
'padding' : 0,
'margin-top' : 5,
'margin-bottom' : 5,
'margin-left' : 5,
'margin-right' : 5
'margin-top' : 0,
'margin-bottom' : 0,
'margin-left' : 0,
'margin-right' : 0
}
# for el in self.__elements:
# for sk in self.__spacing.keys():
# sk = sk.replace('-','_')
# self.arg_parser.add_argument("--" + el + "_" + sk,
# type=float,
# dest=el + "_" + sk,
# help="Spacing " + el + " " + sk)
self.pages = []
for sk in self.__element_spacing.keys():
sk = sk.replace('-','_')
self.arg_parser.add_argument("--element_" + sk,
type=float,
dest="element_" + sk,
help="Spacing element" + " " + sk)
for sk in self.__page_spacing.keys():
sk = sk.replace('-','_')
self.arg_parser.add_argument("--page_" + sk,
type=float,
dest="page_" + sk,
help="Spacing page" + " " + sk)
def svg_traverse_node(self, node, tag=None):
def _tag(tag):
return re.sub(r'\{.*?\}', r'', tag)
def svg_traverse_node(self, node, tag=None, exclude=None):
def _tag(t):
return re.sub(r'\{.*?\}', r'', t)
l = []
if isinstance(node, etree._Element):
if tag is None or _tag(node.tag) == tag:
if (tag is None or _tag(node.tag) == tag) and (exclude is None or _tag(node.tag) != exclude):
l.append(node)
for child in node.getchildren():
l.extend(self.svg_traverse_node(child))
l.extend(self.svg_traverse_node(child, tag=tag, exclude=exclude))
elif isinstance(node, etree._Comment):
pass
elif isinstance(node, list):
for child in node:
l.extend(self.svg_traverse_node(child))
l.extend(self.svg_traverse_node(child, tag=tag, exclude=exclude))
return l
def replace_text(self, selected, substs):
@@ -189,31 +168,34 @@ class InkscapeUprint(inkex.Effect):
for t in tspans:
if t.text is None: continue
t.text = patt.sub(v, t.text)
multilines = t.text.split('\n')
if len(multilines) > 1:
t.text = multilines[0]
for i in range(1, len(multilines)):
new_t = etree.Element('tspan', nsmap=t.nsmap)
new_t.text = multilines[i]
new_t.tail = t.tail
new_t.attrib.update(t.attrib) # copy style
p = t.getparent()
p.insert(p.index(t) + 1, new_t)
# multilines = t.text.split('\n')
# if len(multilines) > 1:
# t.text = multilines[0]
# for i in range(1, len(multilines)):
# new_t = etree.Element('tspan', nsmap=t.nsmap)
# new_t.text = multilines[i]
# new_t.tail = t.tail
# new_t.attrib.update(t.attrib) # copy style
# p = t.getparent()
# p.insert(p.index(t) + 1, new_t)
def duplicate_object(self, parent, selected):
duplicated = []
import copy
for node in selected:
duplicated.append(etree.Element(node.tag, node.attrib, nsmap=node.nsmap))
self.duplicate_object(duplicated[-1], node.getchildren())
duplicated[-1].text = node.text
if 'transform' in node.attrib:
duplicated[-1].set('transform', node.attrib['transform'])
new_node = node.duplicate()
duplicated.append(new_node)
# duplicated.append(etree.Element(node.tag, node.attrib, nsmap=node.nsmap))
# # # inkex.utils.debug(' node.text = ' + str(type(node.text)))
# duplicated[-1].tail = node.tail
# duplicated[-1].text = node.text
# self.duplicate_object(duplicated[-1], node.getchildren())
parent.append(duplicated[-1])
return duplicated
def translate_object(self, obj, x, y):
trans = 'translate(' + str(x) + ',' + str(y) + ')'
trans = 'translate(' + str(float(x)) + ',' + str(float(y)) + ')'
for d in obj:
if 'transform' in d.attrib: d.set('transform', d.get('transform') + ' ' + trans)
else: d.set('transform', trans)
@@ -222,68 +204,92 @@ class InkscapeUprint(inkex.Effect):
if elements is None:
return
first_page = self.svg.getElement("//inkscape:page")
parent = first_page.getparent()
pages = [ node for node in self.svg_traverse_node(parent, tag='inkscape:page')]
rightmost_page = max(pages, key=lambda p: p.get('x'))
if first_page is not None:
page_width = float(first_page.get('width'))
page_height = float(first_page.get('height'))
view = first_page.getparent()
else:
view = self.svg.getElement("//sodipodi:namedview")
if view is None:
inkex.utils.errormsg('No view found')
return
page_width = self.svg.get_page_bbox().width
page_height = self.svg.get_page_bbox().height
pages = [ node for node in self.svg_traverse_node(view, tag='inkscape:page')]
# the reference page is always the first one
pgbbox = {"width": first_page.get('width'), "height": first_page.get('height')}
elbbox = self.svg.selected.bounding_box()
# number of elements per page
nx = int (( float(pgbbox['width']) - self.__page_spacing['margin-left'] - self.__page_spacing['margin-right'] ) / \
( elbbox.width + self.__element_spacing['margin-left'] + self.__element_spacing['margin-right'] ))
ny = int (( float(pgbbox['height']) - self.__page_spacing['margin-top'] - self.__page_spacing['margin-bottom'] ) / \
( elbbox.height + self.__element_spacing['margin-top'] + self.__element_spacing['margin-bottom'] ))
pgbbox = {"width": page_width, "height": page_height}
elbbox = self.bbox
nx = int (( float(pgbbox['width']) - self.__page_spacing['margin-left'] - self.__page_spacing['margin-right'] - self.__element_spacing['padding']) / \
( elbbox.width + self.__element_spacing['padding'] ))
ny = int (( float(pgbbox['height']) - self.__page_spacing['margin-top'] - self.__page_spacing['margin-bottom'] - self.__element_spacing['padding'] ) / \
( elbbox.height + self.__element_spacing['padding'] ))
# remove model position
correct_x = self.svg.selected.bounding_box().left
correct_y = self.svg.selected.bounding_box().top
correct_x = self.bbox.left
correct_y = self.bbox.top
# compute page position zero
px = float(rightmost_page.get('x')) + float(rightmost_page.get('width'))
py = float(rightmost_page.get('y'))
if len(pages) > 0:
rightmost_page = max(pages, key=lambda p: p.get('x'))
px = float(rightmost_page.get('x'))
py = float(rightmost_page.get('y'))
else:
px = 0.
py = 0.
# place elements
for i, el in enumerate(elements):
# create new page if needed
# inkex.utils.debug('nx: '+str(nx) + ' ny: '+str(ny))
if i % int(nx * ny) == 0:
new_page = etree.Element('{http://www.inkscape.org/namespaces/inkscape}page', nsmap=first_page.nsmap)
new_page.set('x', str(float(rightmost_page.get('x')) + float(rightmost_page.get('width')) + 20 ))
new_page.set('y', str(float(rightmost_page.get('y')) + 0 ))
new_page.set('width', str(float(first_page.get('width'))))
new_page.set('height', str(float(first_page.get('height'))))
parent.append(new_page)
new_page = etree.Element('{http://www.inkscape.org/namespaces/inkscape}page', nsmap=view.nsmap)
new_page.set('x', str(px + ( page_width + self.__page_spacing['padding'] )))
new_page.set('y', str(py) )
new_page.set('width', str(page_width))
new_page.set('height', str(page_height))
view.append(new_page)
rightmost_page = new_page
px = float(rightmost_page.get('x'))
py = float(rightmost_page.get('y'))
x = px + (i % nx) * ( elbbox.width + self.__element_spacing['margin-left'] + self.__element_spacing['margin-right'] ) + self.__page_spacing['margin-left']
y = py + (i // nx) * ( elbbox.height + self.__element_spacing['margin-top'] + self.__element_spacing['margin-bottom'] ) + self.__page_spacing['margin-top']
self.translate_object(el, x-correct_x, y-correct_y)
x = px + (i % nx) * ( elbbox.width + self.__element_spacing['padding'] ) \
+ self.__page_spacing['margin-left'] + self.__element_spacing['padding']
y = py + (i % (nx*ny) // nx) * ( elbbox.height + self.__element_spacing['padding'] ) \
+ self.__page_spacing['margin-top'] + self.__element_spacing['padding']
self.translate_object(el, x - correct_x, y - correct_y)
def compute_bounding_box(self, selected):
_tag = lambda t: re.sub(r'\{.*?\}', r'', t)
objs = [ n for n in self.svg_traverse_node(selected[0]) if _tag(n.tag) not in ['text', 'tspan','g'] ]
l = inkex.elements._selected.ElementList(self.svg, objs)
return l.bounding_box()
# inkex.utils.errormsg("pages:" + repr(pages))
# for p in pages:
# inkex.utils.errormsg("p:" + str(p))
pass
def effect(self):
# for el in self.options.element_spacing:
# self.__element_spacing[el] = self.svg.unittouu(str(self.options.element_spacing[el]) + self.options.units)
# for el in self.options.page_spacing:
# self.__page_spacing[el] = self.svg.unittouu(str(self.options.page_spacing[el]) + self.options.units)
# inkex.utils.debug('inkex: ' + inkex.__file__)
parent = self.svg.get_current_layer()
selected = self.svg.selected
for k in self.__page_spacing.keys():
self.__page_spacing[k] = self.svg.unittouu( str(self.options.__dict__['page_'+k.replace('-','_')]) + self.options.units )
for k in self.__element_spacing.keys():
self.__element_spacing[k] = self.svg.unittouu(str(self.options.__dict__['element_'+k.replace('-','_')]) + self.options.units)
if selected:
self.bbox = selected.bounding_box()
self.x_offset = self.svg.unittouu(str(self.options.x) + self.options.units)
self.y_offset = self.svg.unittouu(str(self.options.y) + self.options.units)
self.bbox = self.compute_bounding_box(selected)
if self.bbox is None:
inkex.utils.errormsg('bbox is None')
# self.x_offset = self.svg.unittouu(str(self.options.x) + self.options.units)
# self.y_offset = self.svg.unittouu(str(self.options.y) + self.options.units)
else:
inkex.utils.errormsg("Error - No object selected")
# self.place_in_pages()
return
wb = openpyxl.load_workbook(self.options.subst_file)