JoshRula Posted July 18, 2023 Share Posted July 18, 2023 I am attempting to make an object that fills a page regardless of page size, TBB_GetPageArea reports dimensions that are a bit larger then what is set on page set up. what am I missing? VAR {******Page Corners} PCTL, PCTR, PCBL, PCBR :point; {********Layer Scale} rLScale : real; {*******DrawingArea} outDrawingArea:string; outIsOther:boolean; outIsOnePrintedPage:boolean; sDrawingArea:string; TBTL,TBBR :point; rPageWidth, rPageHeight:real; rPageWPerc, rPageHPerc:real; BEGIN; {********************* Set Page Corner Locations ********************************} TBB_GetPageArea(ActLayer,rPageWidth,rPageHeight); rLScale := GetLScale(ActLayer); GetDrawingArea(outDrawingArea,outIsOther,outIsOnePrintedPage); PCTL.x:= (0-((rPageWidth/2)-.36)*rLScale); PCTL.y:= (((rPageHeight/2)-.36)*rLScale); PCTR.x:= (((rPageWidth/2)+.36)*rLScale); PCTR.y:= (((rPageHeight/2)-.36)*rLScale); PCBL.x:= ((0-(rPageWidth/2)+.36)*rLScale); PCBL.y:= ((0-(rPageHeight/2)+.36)*rLScale); PCBR.x:= ((rPageWidth/2)-.36)*rLScale; PCBR.y:= ((0-(rPageHeight/2)+.36)*rLScale); {**********************************************************************} (* rect(PCTL.x,PCTL.y,PCBR.x,PCBR.y); rect(PCTL.x,PCTL.y,PCBR.x,PCBR.y); *) rPageWPerc:=1/rPageWidth; rPageHPerc:=1/rPageHeight; TBTL.x:=rPageWidth-(rPageWidth*.1); TBTL.y:=rPageHeight-(rPageHeight*.1); TBBR.x:=rPageWidth; TBBR.y:=rPageHeight; rect(PCTL.x,PCTL.y,PCBR.x,PCBR.y); Message(concat(rPageWidth,' ',rPageHeight,' ',rLScale,' ',outDrawingArea)); END; RUN(DrawToScale); Quote Link to comment
Pat Stanford Posted July 18, 2023 Share Posted July 18, 2023 I think you want to use GetDrawingSizeRectN instead. It should give the the top left and bottom right points without any of the extra math you are doing. Quote Link to comment
SamIWas Posted July 19, 2023 Share Posted July 19, 2023 TBB_GetPageArea gives me exact page size if I use a borderless page size in printer setup, and .00166666" off if using a page size with borders. Would be close enough for my needs. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.