r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[View] discuss view related issues

Anton
20-Sep-2006
[5536]
There is no "scope" in rebol. When you read from a url, you create 
a new string. That is, READ returns a new string.

When you set a word to that new string, you "switch" the word away 
from its old value (if it had one.) Eg:


 At the beginning of this example, the word  'info-resp  has no value 
 (It is unset!).
	Now, we set its value to the string returned by READ:

		info-resp: read url

	Now,  'info-resp  points to a string  "[ text ... ]"
	Let's do it again:

		info-resp: read url


 We have re-set  'info-resp  to a new string!  (even though old string 
 and new string look exactly same.)

 The old string may still exist as a value somewhere, but  'info-resp 
  does not know about it anymore.
	Normally this is not a problem.
--
	However, look at this example:
	
	1)	window: layout [box red]
	2)	view/new window
	3)	window: layout [box red]
	4)	unview/only window


 On line 1, LAYOUT creates a face object which we assign to the word 
  'window . (So  'window  points to a face.)
	On line 2, VIEW opens the value of  'window  as a window.

 On line 3, LAYOUT creates a *new* face object which we assign to 
 the word  'window.

  So  'window  points to a *new* face, and it has forgotten about the 
  old face.
		However, the old face is **still open as a window**.

  So we have lost our reference to the old window face, and it is now 
  more difficult for us to close it.
		So line 3 has created a problem.

 On line 4, we try to close the new window face, but we are unsuccessful 
 because the new window face is not open.
Janeks
20-Sep-2006
[5537]
Now I believe, that I understood.

If it is just a variable with a value, than there is not problem, 
but layout are not doing just a face value assignment to a variable, 
but <b>creates new</b> one face and add reference to that face to 
variable.
Anton
20-Sep-2006
[5538x3]
No, LAYOUT only creates a face. It does not add a reference to a 
variable. The set-word (eg.  info-win: )  takes the value that LAYOUT 
returns, and associates it with the word (eg.  'info-win ).
Actually, I think you understand ok. Yes, LAYOUT creates a *new* 
face every time.
For those creating documentation involving a face hierarchy, here's 
a function which may help to visualise it:
do http://anton.wildit.net.au/rebol/doc/demo-to-3d-layout-image.r
Graham
21-Sep-2006
[5541]
Anyone any ideas of how to take a plain paper form and turn it into 
an electronic form that can have text entered into it and then print 
it ?
Henrik
21-Sep-2006
[5542x2]
as in X-forms?
in open office you can create X-forms that can be converted to PDF, 
opened in adobe reader as a form which then can be printed
Graham
21-Sep-2006
[5544x3]
Looking for a Rebol solution :)
But interesting ..
So, open office can create a pdf form ?
Henrik
21-Sep-2006
[5547]
yes, straight out of the box
Graham
21-Sep-2006
[5548]
So, how then to prepopulate the form ?
Henrik
21-Sep-2006
[5549]
I haven't played too much with that, but I think it's possible.
Graham
21-Sep-2006
[5550]
So, you create an xml form which acrobat can read??
Henrik
21-Sep-2006
[5551x3]
yes
if you export it as PDF
http://www.openoffice.org/dev_docs/features/2.0/images/xforms.jpg
Graham
21-Sep-2006
[5554x2]
Say you scan an existing paper form into jpg.
how to go from there ?
Henrik
21-Sep-2006
[5556]
you'd place it as a background image on the document page and then 
place the text fields where you want them.
Graham
21-Sep-2006
[5557x2]
How to print it though?
save as PNG and print?
Henrik
21-Sep-2006
[5559x2]
no, you'd export it as PDF, open it in adobe reader and print it 
there
you can fill the form inside adobe reader
Graham
21-Sep-2006
[5561]
So, if you export as pdf... you can then do a search and replace 
for the prepopulated text and then present this to acrobat?
Henrik
21-Sep-2006
[5562x2]
I'm not sure I follow you there...
is the form not meant to be populated manually by a user?
Graham
21-Sep-2006
[5564]
I want to take an existing paper form .. prefill it with some default 
values that vary for each user... get the user to fill in the rest 
and then print.
Henrik
21-Sep-2006
[5565]
those default values will vary with the user?
Graham
21-Sep-2006
[5566]
yes .. taken from a database
Henrik
21-Sep-2006
[5567x2]
I'm not certain if you can do that...
OO.o is capable of taking values from a database and put it in a 
document, but I'm not sure if those values can be transferred to 
a PDF form.
Graham
21-Sep-2006
[5569x3]
Starting with Rebol .. I can create a VID form using the scanned 
jpg as the background.
I can overlay some VID text boxes over the form areas.
I can then save the completed form as a PNG and print it ... sort 
of ..
Henrik
21-Sep-2006
[5572x2]
yeah, there is something missing there...
if we had the possibility of using bitmaps in postscript or pdf-maker, 
then you could solve it in rebol
Graham
21-Sep-2006
[5574x2]
pdf-maker doesn't support pdf forms yet.
Gabriele doesn't have any current plans to do so either.
Henrik
21-Sep-2006
[5576]
that wouldn't be necessary if you used a VID app to fill out the 
form, right?
Graham
21-Sep-2006
[5577]
so, VID => pdf using pdf-maker?
Henrik
21-Sep-2006
[5578]
you could do that if pdf-maker supported bitmaps properly
Graham
21-Sep-2006
[5579]
and it doesn't ??
Henrik
21-Sep-2006
[5580x2]
well I have not had any success with it
and it only supports uncompressed bitmaps
Graham
21-Sep-2006
[5582x3]
Oh, an alternative idea then.
Scan in as whatever .. turn it into an eps.
take the vid data and write it over the eps .... where you want the 
data ..and send to postscript printer.
Henrik
21-Sep-2006
[5585]
that might work