Nested SVG in 4D?

(I’m sorry to be writing English in a French forum: but there’s no English SVG forum)

Here’s my problem: I am using SVG as a report printing mechanism: building text/lines/rectangles in SVG to make multiple “pages” then covert it all to PDF using a special RSVG-convert.

I’ve run into a challenge where we try to merge multiple multi-page reports that may have mixed orientation (portrait/landscape) in the same PDF.

I’ve figured that I could transform entire pages by embedding the top level SVG element inside an higher SVG element, and then use transformations to rotate and scale it. My problem is that I’ve tried even simple examples of nesting svg within svg in 4D, and can’t seem to get the inner svg to render at all (at least on screen: although I haven’t tried it to the pdf yet)

Is 4D capable of rendering nested SVG?

Also, I wish 4D would add to their on-line documentation a statement about what version of SVG it supports.

Hello Tony,

: Tony RINGSMUTH

Is 4D capable of rendering nested SVG?
No.
But, you can reference (or embed) svg pictures

If I understand properly, yes, you can just build an highest svg with others svg.
For that, you need to give the reference not of the new svg command, but create in each svg a group where you put all in it. Each group must be drawn with the reference of the main higher reference.

That’s all !

nesting makes the coordinate system really complicated.

https://www.w3.org/TR/SVG/coords.html

https://www.sarasoueidan.com/blog/mimic-relative-positioning-in-svg/

it’s an interesting proposition,
but not necessarily something designed or needed for multi-page PDFs, I think…

and I get what you mean by SVG version, but the version is irrelevant here.

4D supports SVG 1.1 and a subset of 1.2 Tiny.
but the version number is used to qualify the syntax,
user agents are not required to implement every feature specified in a W3C draft.

you are more like looking for a “caniuse” type of matrix.

for reference:

example of PDF with different paper sizes.

https://github.com/4D-JP/4d-tips-print-variable-document-size

Thanks Miyako.

I don’t think I’ll use GhostScript. I have a constraint on my plugin-size.

My project is built around the specialized version of rsvp-convert that you built for me. It works fantastically!

My only challenge (currently) is to have mixed orientations.

for reference, https://github.com/miyako/console-rsvg-convert

GS has a CLI implementation too

https://www.ghostscript.com/doc/9.22/Use.htm


by the way, if you are using RSVG, should not the question be,
if RSVG supports nested SVG, and not about 4D?