w3c / svgwg

SVG Working Group specifications
Other
708 stars 133 forks source link

Provide Spec support for Inkscape Pages; multiple-viewbox #889

Open tatarize opened 2 years ago

tatarize commented 2 years ago

Inkscape circa version 1.2 supports pages. This is a pretty reasonable feature and should be considered. This would require that <page> be added and contain x y, width, height, id, and optionally label. This page serves as an alternative viewbox.

The rest of the document remains the same.

<svg
   width="210mm"
   height="297mm"
   viewBox="0 0 210 297"
   version="1.1"
   id="svg5"
   inkscape:version="1.2 (dc2aedaf03, 2022-05-15)"
   sodipodi:docname="2pages.svg"
   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="namedview7"
     pagecolor="#ffffff"
     bordercolor="#666666"
     borderopacity="1.0"
     inkscape:showpageshadow="2"
     inkscape:pageopacity="0.0"
     inkscape:pagecheckerboard="0"
     inkscape:deskcolor="#d1d1d1"
     inkscape:document-units="mm"
     showgrid="false"
     inkscape:zoom="0.2102413"
     inkscape:cx="525.58655"
     inkscape:cy="558.88162"
     inkscape:window-width="1920"
     inkscape:window-height="1018"
     inkscape:window-x="-8"
     inkscape:window-y="497"
     inkscape:window-maximized="1"
     inkscape:current-layer="layer2">
    <inkscape:page
       x="0"
       y="0"
       width="210"
       height="297"
       id="page3950" />
    <inkscape:page
       x="279.38135"
       y="55.372883"
       width="205.13135"
       height="298.25848"
       id="page3952" 
       inkscape:label="hi" />
  </sodipodi:namedview>

Objects outside the viewbox are unseen (usually), so the additional information for the additional pages are generally hidden unless the viewbox is switched to the specific page.

This could permit svgs to somewhat compete with PDFs and provide general support for multiple-page documents. And in the simplest form this all operate within the same space, and page changing is merely a change in the viewbox.

Doktorchen commented 2 years ago

The element view already has a similar functionality, well, more flexible. One can group with the g element and chose with linking or declarative animation. If one needs something like a book with a viewer, that provides a functionality to switch to the next chapter, one can use usually SVG-documents within an EPUB3-archive, even in mixture with XHTML-documents and several more features to combine documents to a digital book.

tatarize commented 2 years ago

That sounds like you could mimic the functionality with other external standards. At that rate you could just have different files for different pages.

Doktorchen commented 2 years ago

This is the idea of an EPUB archive as digital book - the advantage to contain lots of documents joint together to a book.

But if you need it in one SVG file, you can use the SVG view element, the a element for links to the next view respectively some interactive declarative animation of the viewBox attribute of a view or the root svg element. Finally it is not less than to indicate pages breaks, it is more flexible instead.