PDF-Maker with computed strings

Started by Brother Damian on 9-Sep-2016/8:47:45-7:00
HI! I'm trying to produce a .pdf document from within a Rebol script using PDF-Maker, version 1.27, where the text to be output is concatenated based on conditional statements. I've been following Nick's great tutorial and understand that when using computed values it is very important to include the compose/deep evaluation. I was able to run Nick's example but when I try the following, the page comes out blank. Any ideas why? R E B O L [] do %pdf-maker.r mytext: {This text would be built by conditional string concatenation} page1: compose/deep [ -[ page size 215.9 279.4 textbox [ mytext ] ] ] write/binary %mypdf.pdf layout-pdf page1 call %mypdf.pdf Thanks in advance!
Have you checked the value of page1? I get == [[ page size 215.9 279.4 textbox [mytext] ]] Try this: page1: compose/deep [ [ page size 215.9 279.4 textbox [ (mytext) ] ] ] Now this result is: == [[ page size 215.9 279.4 textbox [{This text would be built by conditional string concatenation}] ]] Better?
In trying to get the value from the word 'mytext, I have attempted to replace it with: :mytext rejoin [ mytext " " ] Reduce (mytext) compose (mytext) But they all return a blank page. Any suggestions?
Hi Arnold, the replacement: (mytext) worked perfectly. Thanks for your help. I guess that the compose/deep needed the parentheses to evaluate the expression and no further effort was necessary.
Yes, and you could have known if you had read a little further on to the next example, that used the () frequently. (Strangely I remembered I could use them).

Reply