Hello everyone! strange to say, i need your help once more. As usual by me, it's a bit complicated... It may seem a bug, but i also think it may be me, so here's the explanation.
NOTES: i'm using Inkscape 0.45+devel (Dec 8 2007) All of this is done via PHP, no human action. Here i am reporting values dumped from the PHP script itself
The issue: Plz cosider this simple code:
<svg width="2160in" height="2160in" viewBox="0 0 2160 2160" xmlns="http://www.w3.org/2000/svg" xml:space="preserve" shape-rendering="geometricPrecision" text-rendering="geometricPrecision" image-rendering="optimizeQuality" fill-rule="evenodd" clip-rule="evenodd" xmlns:xlink="http://www.w3.org/1999/xlink"> <g id="text_4" transform="translate(1080,1080)"> <text id="text_4_1" transform="translate(0,0)" style=" text-anchor:start; font-size: 90; font-family: 'Times New Roman'; font-style: italic; font-weight: bold; fill: #000000; fill-opacity: 1; stroke: none;">SCHOOL BOARD</text> </g> </svg>
It's simply a textline inside a big canvas. What i need to do is to export in PDF only the text_4 object. I need it perfectly trimmed, so that the PDF will be exactly sized over it. As the export-id option seems to work only for PNG export, i tried to do this: - use query-width and query-height to find "text_4 object" size - create a new SVG using the resulted values as width and height - finally export the new SVG in PDF
The results of the queries on the avobe file are: inkscape -z svgfile.svg --query-width --query-id text_4 => 66073.068 inkscape -z svgfile.svg --query-height --query-id text_4 => 8594.1
NOTE: I queried text_4 and not text_4_1 because sometimes i will have multiline texts here, and so other text_4_2, text_4_3, etc... inside text_4. text_4 is the container, i need all the "text_4_xxx" in the same PDF. Anyhow, for this specific case, i also tested the query on ID text_4_1: as expected, same result.
Values are "SVG user units", which are 90 DPI. So next i divided the values by 90: 66073.068/90=734.1452 8594.1/90=95.49
And finally i create the "last" SVG file:
<svg width="734.1452in" height="95.49in" viewBox="0 0 734.1452 95.49" xmlns="http://www.w3.org/2000/svg" xml:space="preserve" shape-rendering="geometricPrecision" text-rendering="geometricPrecision" image-rendering="optimizeQuality" fill-rule="evenodd" clip-rule="evenodd" xmlns:xlink="http://www.w3.org/1999/xlink"> <rect x="0" y="0" width="734.1452" height="95.49" style="fill: none;" /> <g transform="translate(0,95.49)"> <text id="text_4_1" transform="translate(0,0)" style=" text-anchor:start; font-size: 90; font-family: 'Times New Roman'; font-style: italic; font-weight: bold; fill: #000000; fill-opacity: 1; stroke: none;">SCHOOL BOARD</text> </g> </svg>
As you can see, it's the same identical "text_4_1" line, there's nothing there to alter it. At this point i would have expected the PDF exported from this 2nd SVG to be fine... but it's not at all.
Any ideas/suggestion/hints? Am i doing something wrong? Is there some simpler way to export a "trimmed" object alone in a PDF file? I think i may have missed something about SVG units conversion, maybe.
Thanks in advance, sorry for the long post.
Alex
Just to clarify--do you want your text to be 90 inches tall? or do you want the text to be scaled to fill a viewbox that is 2160 inches wide?
On Dec 16, 2007 6:09 PM, Alexander Bonivento <redna379@...12...> wrote:
Hello everyone! strange to say, i need your help once more. As usual by me, it's a bit complicated... It may seem a bug, but i also think it may be me, so here's the explanation.
NOTES: i'm using Inkscape 0.45+devel (Dec 8 2007) All of this is done via PHP, no human action. Here i am reporting values dumped from the PHP script itself
The issue: Plz cosider this simple code:
<svg width="2160in" height="2160in" viewBox="0 0 2160 2160" xmlns=" http://www.w3.org/2000/svg" xml:space="preserve" shape-rendering="geometricPrecision" text-rendering="geometricPrecision" image-rendering="optimizeQuality" fill-rule="evenodd" clip-rule="evenodd" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="text_4" transform="translate(1080,1080)"> <text id="text_4_1" transform="translate(0,0)" style=" text-anchor:start; font-size: 90; font-family: 'Times New Roman'; font-style: italic; font-weight: bold; fill: #000000; fill-opacity: 1; stroke: none;">SCHOOL BOARD</text> </g> </svg>
It's simply a textline inside a big canvas. What i need to do is to export in PDF only the text_4 object. I need it perfectly trimmed, so that the PDF will be exactly sized over it. As the export-id option seems to work only for PNG export, i tried to do this:
- use query-width and query-height to find "text_4 object" size
- create a new SVG using the resulted values as width and height
- finally export the new SVG in PDF
The results of the queries on the avobe file are: inkscape -z svgfile.svg --query-width --query-id text_4 => 66073.068 inkscape -z svgfile.svg --query-height --query-id text_4 => 8594.1
NOTE: I queried text_4 and not text_4_1 because sometimes i will have multiline texts here, and so other text_4_2, text_4_3, etc... inside text_4. text_4 is the container, i need all the "text_4_xxx" in the same PDF. Anyhow, for this specific case, i also tested the query on ID text_4_1: as expected, same result.
Values are "SVG user units", which are 90 DPI. So next i divided the values by 90: 66073.068/90=734.1452 8594.1/90=95.49
And finally i create the "last" SVG file:
<svg width="734.1452in" height="95.49in" viewBox="0 0 734.1452 95.49" xmlns="http://www.w3.org/2000/svg" xml:space="preserve" shape-rendering="geometricPrecision" text-rendering="geometricPrecision" image-rendering="optimizeQuality" fill-rule="evenodd" clip-rule="evenodd" xmlns:xlink="http://www.w3.org/1999/xlink">
<rect x="0" y="0" width="734.1452" height="95.49" style="fill: none;" /> <g transform="translate(0,95.49)"> <text id="text_4_1" transform="translate(0,0)" style=" text-anchor:start; font-size: 90; font-family: 'Times New Roman'; font-style: italic; font-weight: bold; fill: #000000; fill-opacity: 1; stroke: none;">SCHOOL BOARD</text> </g> </svg>
As you can see, it's the same identical "text_4_1" line, there's nothing there to alter it. At this point i would have expected the PDF exported from this 2nd SVG to be fine... but it's not at all.
Any ideas/suggestion/hints? Am i doing something wrong? Is there some simpler way to export a "trimmed" object alone in a PDF file? I think i may have missed something about SVG units conversion, maybe.
Thanks in advance, sorry for the long post.
Alex
SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace _______________________________________________ Inkscape-user mailing list Inkscape-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-user
Hope this will make everything simpler: i don't need any of those conditions.
My script will manage the PDFs with other tools later, so considering also PDF is vector i don't need text to have any specific size. I just need the PDF to contain exactly the text, without any margin.
So, there are also no specific reason to have inches: i think every unit measure will be good as well.
What i have as "input" to manage is simply the textline(s) itself, and it's style.
Tom Davidson wrote:
Just to clarify--do you want your text to be 90 inches tall? or do you want the text to be scaled to fill a viewbox that is 2160 inches wide?
On Dec 16, 2007 6:09 PM, Alexander Bonivento < redna379@...12... mailto:redna379@...12...> wrote:
Hello everyone! strange to say, i need your help once more. As usual by me, it's a bit complicated... It may seem a bug, but i also think it may be me, so here's the explanation. NOTES: i'm using Inkscape 0.45+devel (Dec 8 2007) All of this is done via PHP, no human action. Here i am reporting values dumped from the PHP script itself The issue: Plz cosider this simple code: <svg width="2160in" height="2160in" viewBox="0 0 2160 2160" xmlns=" http://www.w3.org/2000/svg" xml:space="preserve" shape-rendering="geometricPrecision" text-rendering="geometricPrecision" image-rendering="optimizeQuality" fill-rule="evenodd" clip-rule="evenodd" xmlns:xlink=" http://www.w3.org/1999/xlink"> <g id="text_4" transform="translate(1080,1080)"> <text id="text_4_1" transform="translate(0,0)" style=" text-anchor:start; font-size: 90; font-family: 'Times New Roman'; font-style: italic; font-weight: bold; fill: #000000; fill-opacity: 1; stroke: none;">SCHOOL BOARD</text> </g> </svg> It's simply a textline inside a big canvas. What i need to do is to export in PDF only the text_4 object. I need it perfectly trimmed, so that the PDF will be exactly sized over it. As the export-id option seems to work only for PNG export, i tried to do this: - use query-width and query-height to find "text_4 object" size - create a new SVG using the resulted values as width and height - finally export the new SVG in PDF The results of the queries on the avobe file are: inkscape -z svgfile.svg --query-width --query-id text_4 => 66073.068 inkscape -z svgfile.svg --query-height --query-id text_4 => 8594.1 NOTE: I queried text_4 and not text_4_1 because sometimes i will have multiline texts here, and so other text_4_2, text_4_3, etc... inside text_4. text_4 is the container, i need all the "text_4_xxx" in the same PDF. Anyhow, for this specific case, i also tested the query on ID text_4_1: as expected, same result. Values are "SVG user units", which are 90 DPI. So next i divided the values by 90: 66073.068/90= 734.1452 8594.1/90=95.49 And finally i create the "last" SVG file: <svg width="734.1452in" height="95.49in" viewBox="0 0 734.1452 95.49" xmlns=" http://www.w3.org/2000/svg" xml:space="preserve" shape-rendering="geometricPrecision" text-rendering="geometricPrecision" image-rendering="optimizeQuality" fill-rule="evenodd" clip-rule="evenodd" xmlns:xlink=" http://www.w3.org/1999/xlink"> <rect x="0" y="0" width="734.1452" height="95.49" style="fill: none;" /> <g transform="translate(0,95.49)"> <text id="text_4_1" transform="translate(0,0)" style=" text-anchor:start; font-size: 90; font-family: 'Times New Roman'; font-style: italic; font-weight: bold; fill: #000000; fill-opacity: 1; stroke: none;">SCHOOL BOARD</text> </g> </svg> As you can see, it's the same identical "text_4_1" line, there's nothing there to alter it. At this point i would have expected the PDF exported from this 2nd SVG to be fine... but it's not at all. Any ideas/suggestion/hints? Am i doing something wrong? Is there some simpler way to export a "trimmed" object alone in a PDF file? I think i may have missed something about SVG units conversion, maybe. Thanks in advance, sorry for the long post. Alex ------------------------------------------------------------------------- SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace <http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace> _______________________________________________ Inkscape-user mailing list Inkscape-user@lists.sourceforge.net <mailto:Inkscape-user@lists.sourceforge.net> https://lists.sourceforge.net/lists/listinfo/inkscape-user
SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
Inkscape-user mailing list Inkscape-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-user
participants (2)
-
Alexander Bonivento
-
Tom Davidson