scaling to fit using image height

Please post all questions and comments regarding Help & Manual 7 here.

Moderators: Alexander Halser, Tim Green

scaling to fit using image height

Unread postby simon harris » Wed Aug 14, 2019 2:55 am

Hi Tim,

I could not find this question already asked on forum, so here goes. Our engineering team have at times decided that creating physical drawings the size of king-single beds perfectly acceptable and, often with relatively arbitrary paper sizes. I spoze to them it is, however, when it comes to shrinking the things down to fit on an A4 page (with margins), this is proving to be a hassle as the images extend beyond the bottom of the page. I can "make" them fit by repeatedly fiddling with absolute sizing - publish - check - tweak - publish - check etc. That gets a bit boring, especially when the image heights are not constant. Is it possible to scale an image based on its height and the height of the available space? Similarly to the current scale according to width function. Something that I thought might work was to stick the image in a single-cell table and make sure that table row can't break over page, but that didn't come up trumps...

Thanking you!!
All the best,
Simon
simon harris
 
Posts: 30
Joined: Thu Jul 26, 2018 1:35 am
Location: syd - AU

Re: scaling to fit using image height

Unread postby Tim Green » Wed Aug 14, 2019 7:04 am

Hi Simon,

Unfortunately, this isn't supported at the moment. As in a number of other areas, Help+Manual uses an HTML-based paradigm and scaling is based on width, not height (height is never a problem in HTML pages, because you can always scroll down). An ability like this may be added in the future but even then the results will almost certainly make you a lot less happy than you hope. Whereas the space between the left and right margins of a page is very easy to calculate, the available vertical space is much more complex issue. It is even more difficult in Help+Manual, because in the editor you have no way of knowing where on the page the image is going to end up. Since the layout must be separate from the text source because you are supporting so many different output formats the pagination cannot be decided until you publish. :?
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
User avatar
Tim Green
Site Admin
 
Posts: 20889
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany

Re: scaling to fit using image height

Unread postby Simon_Dismore » Wed Aug 14, 2019 4:32 pm

simon harris wrote:physical drawings the size of king-single beds ... shrinking the things down to on an A4 page
Tim Green wrote:the layout must be separate from the text source because you are supporting so many different output formats [and therefore] the pagination cannot be decided until you publish.

Tim's comment reminded me that SVGs seem to get printed OK if they are the top-level window in the browser, e.g. if you browse to an SVG URI rather than an HTML page.

I've done some experiments around this and it turns out you can get an SVG to scale correctly if you call window.print() from within your SVG. That means the SVG has to be loaded using a method that allows scripting, e.g. <iframe> or <object>. I've written this up as Printing just an SVG rather than a page in the 'Tips & Tricks' forum.

Perhaps that would work in your scenario, either by converting each drawing to SVG or by hosting the bitmap drawing in the SVG via the <image> tag.
Simon_Dismore
 
Posts: 120
Joined: Thu Jul 13, 2017 2:57 pm

Re: scaling to fit using image height

Unread postby simon harris » Thu Aug 15, 2019 3:49 am

Hi Tim and Simon,

Thanks for your replies. Yes, I understand the height concept and that it might have carried with it some inherent difficulties, Tim but I had to ask. Suffice to say that my problem was more exception rather than rule. Must be grateful for that. With your SVG suggestion, Simon, I have previously endeavoured with SVG (not for this, but just in general), however, it did not work particularly well for the material I deal with as an image format. To be honest, your suggestion is a bit beyond my ability anyhoo. :D
All the best,
Simon
simon harris
 
Posts: 30
Joined: Thu Jul 26, 2018 1:35 am
Location: syd - AU


Return to Help & Manual 7 Forum

Who is online

Users browsing this forum: No registered users and 7 guests

cron