Re: Is there a property resolver in the FOP API?
Daniel Norberg <[email protected]> Thu, 7 May 2026 19:16:16 +0000
| Newsgroups | gmane.text.xml.fop.user |
|---|---|
| Message-ID | <DBBPR08MB10590A59D1331593908CAB07C993C2@DBBPR08MB10590.eurprd08.prod.outlook.com> |
--_000_DBBPR08MB10590A59D1331593908CAB07C993C2DBBPR08MB10590eu_ Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable Hi Chris, Thank you so much for the advise, I didn't know about the intermediate form= at, I will definitely explore that possibility and see if that can solve my= problem. Even though I could write my own utility methods for solving the = task the best way to get correct answers is to use the same computations th= at FOP uses when it produces the PDF. Best regards/V=E4nliga h=E4lsningar Daniel Norberg -- [X] Excosoft =95 Daniel Norberg =95 Developer =95 Application Consultant S=F6derv=E4gen 70, SE-183 64 T=E4by, SWEDEN Cell +46 (0)76-199 31 85 Email [email protected]<mailto:[email protected]> www.excosoft.se<http://www.excosoft.se/> ________________________________ From: Chris Bowditch <[email protected]> Sent: Thursday, May 7, 2026 19:11 To: [email protected] <[email protected]> Subject: Re: Is there a property resolver in the FOP API? Hi Daniel, No such function exists. Take a look at the intermediate format: Apache(tm)= FOP: Intermediate Format<https://xmlgraphics.apache.org/fop/trunk/intermed= iate.html> What you can do is generate the IF XML from the XSL-FO and then you will be= able to see the dimensions of everything within the pages. You can then us= e that information to either alter the original XSL-FO or amend the IF XML = before final rendering. I hope that helps Chris ________________________________ From: Daniel Norberg <[email protected]> Sent: 07 May 2026 18:07 To: [email protected] <[email protected]> Subject: Is there a property resolver in the FOP API? Hi, I am developing support for transformation of FO to PDF with FOP using Java= . I wonder if there is an API method that I can call that resolves a property= ? Here is one example: <fo:block font-size=3D"12pt"> <fo:inline font-size=3D"2em">Lorem ipsum</fo:inline> </fo:block> I want to call a method that can resolve the font-size on the <fo:inline> i= n pt, for instance with a similar code to this: float fontSize =3D FOP.getDimensionValue(element, "font-size"); Is there such a method available in FOP that I can use, or do I have to wri= te my own code to resolve the value? Best regards/V=E4nliga h=E4lsningar Daniel Norberg -- [X] Excosoft =95 Daniel Norberg =95 Developer =95 Application Consultant S=F6derv=E4gen 70, SE-183 64 T=E4by, SWEDEN Cell +46 (0)76-199 31 85 Email [email protected]<mailto:[email protected]> www.excosoft.se<http://www.excosoft.se/> --_000_DBBPR08MB10590A59D1331593908CAB07C993C2DBBPR08MB10590eu_ Content-Type: text/html; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable <html> <head> <meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3DWindows-1= 252"> </head> <body> <div style=3D"font-family: inherit; font-size: inherit; color: inherit; bac= kground-color: transparent;"> </div> <div>Hi Chris, </div> <div><br> </div> <div>Thank you so much for the advise, I didn't know about the intermediate= format, I will definitely explore that possibility and see if that can sol= ve my problem. Even though I could write my own utility methods for solving= the task the best way to get correct answers is to use the same computations that FOP uses when it produces the= PDF. </div> <div><br> </div> <div id=3D"editor-signature"> <div> <div style=3D"background-color:rgb(255,255,255); margin:0px"> <div style=3D"direction:ltr; text-align:left; margin:0px; font-family:Calib= ri,Arial,Helvetica,sans-serif; font-size:11pt; color:black"> <span style=3D"background-color:rgb(255,255,255)">Best regards/V=E4nliga h= =E4lsningar</span></div> <div style=3D"direction:ltr; text-align:left; margin:0px; font-family:Calib= ri,Arial,Helvetica,sans-serif; font-size:11pt; color:black"> <span style=3D"background-color:rgb(255,255,255)">Daniel Norberg</span></di= v> <div style=3D"direction:ltr; text-align:left; margin:0px; font-family:Arial= ,sans-serif; font-size:9pt; color:black"> <b>--</b></div> <div style=3D"direction:ltr; text-align:left; margin:0px; font-family:Calib= ri,Arial,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","= ;Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Andr= oid Emoji",EmojiSymbols; font-size:12pt; color:black"> <b><img></b></div> </div> <div style=3D"background-color:rgb(255,255,255); margin:0px"> <div style=3D"background-color:white; margin:0px"> <p style=3D"direction:ltr; text-align:left; margin-top:0px; margin-bottom:0= px"><span style=3D"font-family:"Open Sans",sans-serif; font-size:= 9pt; color:rgb(10,24,163)"><b>Excosoft =95 Daniel Norberg =95 Develope= r =95 Application Consultant</b></span></p> <p style=3D"direction:ltr; text-align:left; margin-top:0px; margin-bottom:0= px"><span style=3D"font-family:"Open Sans",sans-serif; font-size:= 9pt; color:rgb(46,116,181)">S=F6derv=E4gen 70, SE-183 64 T=E4by, SWEDEN</sp= an></p> <p style=3D"direction:ltr; text-align:left; margin-top:0px; margin-bottom:0= px"><span style=3D"font-family:"Open Sans",sans-serif; font-size:= 9pt; color:rgb(46,116,181)">Cell +46 (0)76-199 31 85</span></p> <p style=3D"direction:ltr; text-align:left; margin-top:0px; margin-bottom:0= px"><span style=3D"font-family:"Open Sans",sans-serif; font-size:= 9pt; color:rgb(46,116,181)">Email<b> </b><a href=3D"mailto:daniel.norb= [email protected]" title=3D"mailto:[email protected]=0A= Ctrl+Click or tap to follow the link" rel=3D"noopener noreferrer" style=3D"= color:rgb(46,116,181); margin:0px" target=3D"_blank">daniel.norberg@excosof= t.se</a></span></p> <p style=3D"direction:ltr; text-align:left; margin-top:0px; margin-bottom:0= px"><span style=3D"font-family:"Open Sans",sans-serif,serif,Emoji= Font; font-size:9pt; color:rgb(46,116,181)"><a href=3D"http://www.excosoft.= se/" rel=3D"noopener noreferrer" style=3D"margin:0px" target=3D"_blank">www= .excosoft.se</a></span></p> </div> </div> </div> </div> <hr style=3D"display:inline-block;width:98%" tabindex=3D"-1"> <div id=3D"divRplyFwdMsg" dir=3D"ltr"><font face=3D"Calibri, sans-serif" st= yle=3D"font-size:11pt" color=3D"#000000"><b>From:</b> Chris Bowditch <bo= [email protected]><br> <b>Sent:</b> Thursday, May 7, 2026 19:11<br> <b>To:</b> [email protected] <[email protected]= e.org><br> <b>Subject:</b> Re: Is there a property resolver in the FOP API?</font> <div> </div> </div> <style type=3D"text/css" style=3D"display:none"> <!-- p {margin-top:0; margin-bottom:0} --> </style> <div dir=3D"ltr"> <div class=3D"x_elementToProof" style=3D"font-family:Calibri,Helvetica,sans= -serif; font-size:12pt; color:rgb(0,0,0)"> Hi Daniel,</div> <div class=3D"x_elementToProof" style=3D"font-family:Calibri,Helvetica,sans= -serif; font-size:12pt; color:rgb(0,0,0)"> <br> </div> <div class=3D"x_elementToProof" style=3D"font-family:Calibri,Helvetica,sans= -serif; font-size:12pt; color:rgb(0,0,0)"> No such function exists. Take a look at the intermediate format: <a href=3D= "https://xmlgraphics.apache.org/fop/trunk/intermediate.html" id=3D"OWA80ee2= ed3-53af-5afb-374c-0cb15159e32d" class=3D"x_OWAAutoLink"> Apache(tm) FOP: Intermediate Format</a></div> <div class=3D"x_elementToProof" style=3D"font-family:Calibri,Helvetica,sans= -serif; font-size:12pt; color:rgb(0,0,0)"> <br> </div> <div class=3D"x_elementToProof" style=3D"font-family:Calibri,Helvetica,sans= -serif; font-size:12pt; color:rgb(0,0,0)"> What you can do is generate the IF XML from the XSL-FO and then you will be= able to see the dimensions of everything within the pages. You can then us= e that information to either alter the original XSL-FO or amend the IF XML = before final rendering.</div> <div class=3D"x_elementToProof" style=3D"font-family:Calibri,Helvetica,sans= -serif; font-size:12pt; color:rgb(0,0,0)"> <br> </div> <div class=3D"x_elementToProof" style=3D"font-family:Calibri,Helvetica,sans= -serif; font-size:12pt; color:rgb(0,0,0)"> I hope that helps</div> <div class=3D"x_elementToProof" style=3D"font-family:Calibri,Helvetica,sans= -serif; font-size:12pt; color:rgb(0,0,0)"> <br> </div> <div class=3D"x_elementToProof" style=3D"font-family:Calibri,Helvetica,sans= -serif; font-size:12pt; color:rgb(0,0,0)"> Chris</div> <div id=3D"x_appendonsend"></div> <hr tabindex=3D"-1" style=3D"display:inline-block; width:98%"> <div id=3D"x_divRplyFwdMsg" dir=3D"ltr"><font face=3D"Calibri, sans-serif" = color=3D"#000000" style=3D"font-size:11pt"><b>From:</b> Daniel Norberg <= [email protected]><br> <b>Sent:</b> 07 May 2026 18:07<br> <b>To:</b> [email protected] <[email protected]= e.org><br> <b>Subject:</b> Is there a property resolver in the FOP API?</font> <div> </div> </div> <style type=3D"text/css" style=3D"display:none"> <!-- p {margin-top:0; margin-bottom:0} --> </style> <div dir=3D"ltr"> <div class=3D"x_x_elementToProof" style=3D"font-family:Calibri,Helvetica,sa= ns-serif; font-size:11pt; color:rgb(0,0,0)"> Hi,</div> <div class=3D"x_x_elementToProof" style=3D"font-family:Calibri,Helvetica,sa= ns-serif; font-size:11pt; color:rgb(0,0,0)"> <br> </div> <div class=3D"x_x_elementToProof" style=3D"font-family:Calibri,Helvetica,sa= ns-serif; font-size:11pt; color:rgb(0,0,0)"> I am developing support for transformation of FO to PDF with FOP using Java= .</div> <div class=3D"x_x_elementToProof" style=3D"font-family:Calibri,Helvetica,sa= ns-serif; font-size:11pt; color:rgb(0,0,0)"> <br> </div> <div class=3D"x_x_elementToProof" style=3D"font-family:Calibri,Helvetica,sa= ns-serif; font-size:11pt; color:rgb(0,0,0)"> I wonder if there is an API method that I can call that resolves a property= ? Here is one example:</div> <div class=3D"x_x_elementToProof" style=3D"font-family:Calibri,Helvetica,sa= ns-serif; font-size:11pt; color:rgb(0,0,0)"> <br> </div> <div class=3D"x_x_elementToProof" style=3D"font-family:"Courier New&qu= ot;,monospace; font-size:11pt; color:rgb(0,0,0)"> <fo:block font-size=3D"12pt"></div> <div class=3D"x_x_elementToProof" style=3D"font-family:"Courier New&qu= ot;,monospace; font-size:11pt; color:rgb(0,0,0)"> <fo:inline font-size=3D"2em">Lorem ipsum</f= o:inline></div> <div class=3D"x_x_elementToProof" style=3D"font-family:"Courier New&qu= ot;,monospace; font-size:11pt; color:rgb(0,0,0)"> </fo:block></div> <div id=3D"x_x_Signature" class=3D"x_x_elementToProof"> <div class=3D"x_x_elementToProof" style=3D"font-family:Calibri,Helvetica,sa= ns-serif; font-size:11pt; color:rgb(0,0,0)"> <br> </div> <div class=3D"x_x_elementToProof" style=3D"font-family:Calibri,Helvetica,sa= ns-serif; font-size:11pt; color:rgb(0,0,0)"> I want to call a method that can resolve the font-size on the <fo:inline= > in pt, for instance with a similar code to this:</div> <div class=3D"x_x_elementToProof" style=3D"font-family:Calibri,Helvetica,sa= ns-serif; font-size:11pt; color:rgb(0,0,0)"> <br> </div> <div class=3D"x_x_elementToProof" style=3D"font-family:Calibri,Helvetica,sa= ns-serif; font-size:11pt; color:rgb(0,0,0)"> float fontSize =3D FOP.getDimensionValue(element, "font-size");</= div> <div class=3D"x_x_elementToProof" style=3D"font-family:Calibri,Helvetica,sa= ns-serif; font-size:11pt; color:rgb(0,0,0)"> <br> </div> <div class=3D"x_x_elementToProof" style=3D"font-family:Calibri,Helvetica,sa= ns-serif; font-size:11pt; color:rgb(0,0,0)"> Is there such a method available in FOP that I can use, or do I have to wri= te my own code to resolve the value?</div> <div class=3D"x_x_elementToProof" style=3D"font-family:Calibri,Helvetica,sa= ns-serif; font-size:11pt; color:rgb(0,0,0)"> <br> </div> <div class=3D"x_x_elementToProof" style=3D"background-color:rgb(255,255,255= ); margin:0px"> <div class=3D"x_x_elementToProof" style=3D"direction:ltr; text-align:left; = margin:0px; font-family:Calibri,Arial,Helvetica,sans-serif; font-size:11pt;= color:black"> <span style=3D"background-color:rgb(255,255,255)">Best regards/V=E4nliga h= =E4lsningar</span></div> <div class=3D"x_x_elementToProof" style=3D"direction:ltr; text-align:left; = margin:0px; font-family:Calibri,Arial,Helvetica,sans-serif; font-size:11pt;= color:black"> <span style=3D"background-color:rgb(255,255,255)">Daniel Norberg</span></di= v> <div class=3D"x_x_elementToProof" style=3D"direction:ltr; text-align:left; = margin:0px; font-family:Arial,sans-serif; font-size:9pt; color:black"> <b>--</b></div> <div class=3D"x_x_elementToProof" style=3D"direction:ltr; text-align:left; = margin:0px; font-family:Calibri,Arial,Helvetica,sans-serif,EmojiFont,"= Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Seg= oe UI Symbol","Android Emoji",EmojiSymbols; font-size:12pt; = color:black"> <b><img></b></div> </div> <div class=3D"x_x_elementToProof" style=3D"background-color:rgb(255,255,255= ); margin:0px"> <div class=3D"x_x_elementToProof" style=3D"background-color:white; margin:0= px"> <p class=3D"x_x_elementToProof" style=3D"direction:ltr; text-align:left; ma= rgin-top:0px; margin-bottom:0px"> <span style=3D"font-family:"Open Sans",sans-serif; font-size:9pt;= color:rgb(10,24,163)"><b>Excosoft =95 Daniel Norberg =95 Developer = =95 Application Consultant</b></span></p> <p class=3D"x_x_elementToProof" style=3D"direction:ltr; text-align:left; ma= rgin-top:0px; margin-bottom:0px"> <span style=3D"font-family:"Open Sans",sans-serif; font-size:9pt;= color:rgb(46,116,181)">S=F6derv=E4gen 70, SE-183 64 T=E4by, SWEDEN</span><= /p> <p class=3D"x_x_elementToProof" style=3D"direction:ltr; text-align:left; ma= rgin-top:0px; margin-bottom:0px"> <span style=3D"font-family:"Open Sans",sans-serif; font-size:9pt;= color:rgb(46,116,181)">Cell +46 (0)76-199 31 85</span></p> <p class=3D"x_x_elementToProof" style=3D"direction:ltr; text-align:left; ma= rgin-top:0px; margin-bottom:0px"> <span style=3D"font-family:"Open Sans",sans-serif; font-size:9pt;= color:rgb(46,116,181)">Email<b> </b><a href=3D"mailto:daniel.norberg@= excosoft.se" target=3D"_blank" title=3D"mailto:[email protected]= =0A= Ctrl+Click or tap to follow the link" rel=3D"noopener noreferrer" style=3D"= color:rgb(46,116,181); margin:0px">[email protected]</a></span></p= > <p class=3D"x_x_elementToProof" style=3D"direction:ltr; text-align:left; ma= rgin-top:0px; margin-bottom:0px"> <span style=3D"font-family:"Open Sans",sans-serif,serif,EmojiFont= ; font-size:9pt; color:rgb(46,116,181)"><a href=3D"http://www.excosoft.se/"= target=3D"_blank" rel=3D"noopener noreferrer" style=3D"margin:0px">www.exc= osoft.se</a></span></p> </div> </div> </div> </div> </div> </body> </html> --_000_DBBPR08MB10590A59D1331593908CAB07C993C2DBBPR08MB10590eu_--