<div dir="ltr">Not sure you can use it in this case, but if you're needing to find standard page sizes and localised names from width x height measurements, the Qt QPageSize class has useful lookup tools. See <a href="https://doc.qt.io/qt-5/qpagesize.html">https://doc.qt.io/qt-5/qpagesize.html</a>.<div><br></div><div>Something like:</div><div><br></div><div>    id = QPageSize.id(QSizeF(width, height), QPageSize.Millimeters)<br></div><div>    name = QPageSize.name(id)</div><div><br></div><div>It does a fuzzy match on size within 3 points, and ignores orientation, so should always get the right standard page size regardless.</div><div><br></div><div>Cheers!</div><div><br></div><div>John.</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 20 May 2021 at 23:17, Tony Shepherd (FarmMaps NZ) <<a href="mailto:tony@farmmaps.nz">tony@farmmaps.nz</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div lang="EN-NZ" style="overflow-wrap: break-word;"><div class="gmail-m_-8490441861056020706WordSection1"><p class="MsoNormal"><span>Hi Charles (& others)<u></u><u></u></span></p><p class="MsoNormal"><span><u></u> <u></u></span></p><p class="MsoNormal"><span>Thanks for the advice guys.  I’ve come up with this, it works a treat.<u></u><u></u></span></p><p class="MsoNormal"><span><u></u> <u></u></span></p><p class="MsoNormal" style="margin-left:36pt">[%'Scale 1:' || format_number(round(map_get(item_variables('Main-Map-1'), 'map_scale'),0),0)||<u></u><u></u></p><p class="MsoNormal" style="margin-left:36pt;text-indent:36pt">CASE<u></u><u></u></p><p class="MsoNormal" style="margin-left:108pt">WHEN @layout_pagewidth IS 297 AND @layout_pageheight IS 210 THEN ' @ A4'<u></u><u></u></p><p class="MsoNormal" style="margin-left:108pt">WHEN @layout_pagewidth IS 210 AND @layout_pageheight IS 297 THEN ' @ A4'<u></u><u></u></p><p class="MsoNormal" style="margin-left:108pt">WHEN @layout_pagewidth IS 420 AND @layout_pageheight IS 297 THEN ' @ A3'<u></u><u></u></p><p class="MsoNormal" style="margin-left:108pt">WHEN @layout_pagewidth IS 297 AND @layout_pageheight IS 420 THEN ' @ A3'<u></u><u></u></p><p class="MsoNormal" style="margin-left:72pt">ELSE ' @ ???'<u></u><u></u></p><p class="MsoNormal" style="margin-left:36pt">END%]<span><u></u><u></u></span></p><p class="MsoNormal"><span><u></u> <u></u></span></p><p class="MsoNormal"><span>Cheers<u></u><u></u></span></p><p class="MsoNormal"><span>Tony<u></u><u></u></span></p><p class="MsoNormal"><span><u></u> <u></u></span></p><div style="border-right:none;border-bottom:none;border-left:none;border-top:1pt solid rgb(225,225,225);padding:3pt 0cm 0cm"><p class="MsoNormal"><b><span lang="EN-US">From:</span></b><span lang="EN-US"> Charles Dixon-Paver <<a href="mailto:charles@kartoza.com" target="_blank">charles@kartoza.com</a>> <br><b>Sent:</b> Friday, 21 May 2021 9:46 am<br><b>To:</b> Tony Shepherd (FarmMaps NZ) <<a href="mailto:tony@farmmaps.nz" target="_blank">tony@farmmaps.nz</a>><br><b>Cc:</b> <a href="mailto:qgis-user@lists.osgeo.org" target="_blank">qgis-user@lists.osgeo.org</a><br><b>Subject:</b> Re: [Qgis-user] Layout page size variable?<u></u><u></u></span></p></div><p class="MsoNormal"><u></u> <u></u></p><div><p class="MsoNormal">Yeah I am not aware of a variable for this... But page sizes are actually more complicated than they seem. You can emulate it pretty easily with something like the following expression on a layout as you suggested:<u></u><u></u></p><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">[%CASE<br>WHEN @layout_pagewidth IS 297 AND @layout_pageheight IS 210 THEN 'On A4 Landscape'<br>WHEN @layout_pagewidth IS 210 AND @layout_pageheight IS 297 THEN 'On A4 Portrait'<br>WHEN @layout_pagewidth IS 420 AND @layout_pageheight IS 297 THEN 'On A3 Landscape'<br>WHEN @layout_pagewidth IS 297 AND @layout_pageheight IS 420 THEN 'On A3 Portrait'<br>ELSE 'With page dimensions of ' || @layout_pagewidth || ' x ' || @layout_pageheight<br>END%]<u></u><u></u></p></div></div><p class="MsoNormal"><u></u> <u></u></p><div><div><p class="MsoNormal">On Thu, 20 May 2021 at 23:13, Tony Shepherd (FarmMaps NZ) <<a href="mailto:tony@farmmaps.nz" target="_blank">tony@farmmaps.nz</a>> wrote:<u></u><u></u></p></div><blockquote style="border-top:none;border-right:none;border-bottom:none;border-left:1pt solid rgb(204,204,204);padding:0cm 0cm 0cm 6pt;margin-left:4.8pt;margin-right:0cm"><div><div><p class="MsoNormal">Hi All<u></u><u></u></p><p class="MsoNormal"> <u></u><u></u></p><p class="MsoNormal">Is there a variable that returns the page size of a print layout?<u></u><u></u></p><p class="MsoNormal"> <u></u><u></u></p><p class="MsoNormal">I would like to add the page size to the scale below so it reads something like “1:5,000 @ A3”<u></u><u></u></p><p class="MsoNormal">I can see variables for width and height, but not Page Size?<u></u><u></u></p><p class="MsoNormal"> <u></u><u></u></p><p class="MsoNormal">Or would I need to code in some ‘if’ &  ‘then’ statements using the width variables to arrive at the page size?<u></u><u></u></p><p class="MsoNormal"> <u></u><u></u></p><p class="MsoNormal"><img border="0" width="356" height="104" style="width: 3.7083in; height: 1.0833in;" id="gmail-m_-8490441861056020706gmail-m_2357712367802510580Picture_x0020_4" src="cid:1798e00afd14cff311"><u></u><u></u></p><p class="MsoNormal"> <u></u><u></u></p><p class="MsoNormal"> <u></u><u></u></p><p class="MsoNormal">Cheers<u></u><u></u></p><p class="MsoNormal">Tony<u></u><u></u></p><p class="MsoNormal"> <u></u><u></u></p><p class="MsoNormal"><b><span style="color:rgb(64,64,64)">Tony Shepherd</span></b><span style="color:rgb(89,89,89)">  </span><b>|</b><span style="color:rgb(89,89,89)">  GeoSpatial / Mapping Manager</span><u></u><u></u></p><p class="MsoNormal"><span style="color:rgb(89,89,89)">Ph 027 435 6193  </span><b>|</b><span style="color:rgb(89,89,89)">  E <a href="mailto:tony@farmmaps.nz" target="_blank"><span style="color:rgb(5,99,193)">tony@farmmaps.nz</span></a></span><u></u><u></u></p><p class="MsoNormal"><span style="color:rgb(89,89,89)">FarmMaps NZ, 3 Kerwood Place, Gore 9740</span><u></u><u></u></p><p class="MsoNormal"><span style="color:rgb(89,89,89)"> </span><u></u><u></u></p><p class="MsoNormal"><span style="color:rgb(89,89,89)"><img border="0" width="160" height="75" style="width: 1.6666in; height: 0.7812in;" id="gmail-m_-8490441861056020706gmail-m_2357712367802510580_x005f_x0000_i1027" src="cid:1798e00afd15b006a2" alt="FM_logo1_small (Custom)"></span><u></u><u></u></p><p class="MsoNormal"><span style="color:rgb(123,123,123)"> </span><u></u><u></u></p><p class="MsoNormal"><b><span style="font-family:Arial,sans-serif;color:rgb(123,123,123)"> </span></b><u></u><u></u></p><p class="MsoNormal"><a href="http://tonyshepherd8.wixsite.com/home" target="_blank"><b><span style="font-family:Arial,sans-serif;color:windowtext;text-decoration:none"><img border="0" width="157" height="34" style="width: 1.6354in; height: 0.3541in;" id="gmail-m_-8490441861056020706gmail-m_2357712367802510580Picture_x0020_1" src="cid:1798e00afd1692e333"></span></b></a><a href="https://www.wunderground.com/personal-weather-station/dashboard?ID=ISTLGORE2" target="_blank"><b><span style="font-family:Arial,sans-serif;color:windowtext;text-decoration:none"><img border="0" width="170" height="37" style="width: 1.7708in; height: 0.3854in;" id="gmail-m_-8490441861056020706gmail-m_2357712367802510580Picture_x0020_3" src="cid:1798e00afd17745b44"></span></b></a><u></u><u></u></p><p class="MsoNormal"> <u></u><u></u></p></div></div><p class="MsoNormal">_______________________________________________<br>Qgis-user mailing list<br><a href="mailto:Qgis-user@lists.osgeo.org" target="_blank">Qgis-user@lists.osgeo.org</a><br>List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a><u></u><u></u></p></blockquote></div></div></div>_______________________________________________<br>
Qgis-user mailing list<br>
<a href="mailto:Qgis-user@lists.osgeo.org" target="_blank">Qgis-user@lists.osgeo.org</a><br>
List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
</blockquote></div>