REBOL3 - Postscript (Emitting Postscript from REBOL [web-public])

Return to Index Page
Most recent messages (300 max) are listed first.

#UserMessageDate
1955Maximget-word-wrap can even return the pair size next to the lines, if you need the info to properly place the text :-)2-Jun-09 13:01
1954HenrikIt's a little annoying having only a 1-2 week window a year to work with postscript.2-Jun-09 13:01
1953HenrikGeomol, there are some subtle bugs that I've not been able to figure out, causing certain layouts not to print, so I stick to a specific version right now.2-Jun-09 13:00
1952Maximthe function is called get-word-wrap in the glayout lib (on rebol.org)2-Jun-09 12:56
1951GeomolDo you use the RIGHT and CENTER options in the dialect in your code today? Would you have to change alot, if I drop the size in the dialect?2-Jun-09 12:56
1950HenrikGeomol, I guess it doesn't harm layout capabilities.2-Jun-09 12:54
1949Henrikthis will be useful when I will get to finish the function, perhaps in a month or so.2-Jun-09 12:53
1948Maximyou can use it to wordwrap draw text too.2-Jun-09 12:53
1947Maximyes.2-Jun-09 12:52
1946MaximI was using it specifically to build HUGE tables (300000cells) and its deadly fast.2-Jun-09 12:52
1945HenrikMaxim, so they will be identical to what is seen in View instead of DRAW?2-Jun-09 12:52
1944Maximglayout wordwrap functions uses the internal view commands which calculate word-wrap.2-Jun-09 12:51
1943GeomolI like the second way better.2-Jun-09 12:49
1942Geomolat 0x0 "some long text that will be right aligned" right 800

is the same as

at 800x0 "some long text that will be right aligned" right

2-Jun-09 12:49
1941GeomolIt should make no difference. Dropping the size just mean, you need to add the size to the possition yourself. The thing is, in my examples here, I often know the final right border (pos + size), so I always have size set to zero. And then it struck me, that I don't need the size.2-Jun-09 12:48
1940Henrikoops, size marker, not position marker2-Jun-09 12:46
1939Henrikif you drop the position marker, will it be simpler or harder to build formatted tables?2-Jun-09 12:46
1938Henrikhttp://rebol.hmkdesign.dk/files/vid-postscript2.png2-Jun-09 12:43
1937Geomolhm, I remember something about that. I think, I tried it a while ago.

But what about the suggestion for a change to the dialect?

2-Jun-09 12:43
1936Henrikinteresting. how does it work?2-Jun-09 12:43
1935Maximthere is VID manual word-wrapping code in glayout lib if you need it.2-Jun-09 12:42
1934Henrikit does not do word wrapping however. that's a problem that I've not yet solved.2-Jun-09 12:37
1933HenrikGeomol, did you try my VID->postscript conversion function? It might be able to do some of what you need.2-Jun-09 12:37
1932GeomolBecause all content in the dialect starts with a word or a string, I could make the size optional. It will just mean a more complicated dialect, but it won't break your code.2-Jun-09 11:03
1931GeomolI'm working on a Print Markup Language for a customer, that will output the REBOL postscript dialect, so it can produce PostScript and PDF output. When producing text, it's possible to specify centered and right-aligned text by using the words CENTER or RIGHT after the text followed by the size of the area, wherein the text should be aligned. Example:

at 100x100 "Right-aligned text" right 400

has the same effect as:

at 500x100 "Right-aligned text" right 0

Suggestion: The dialect will be more simple, if the size is dropped. Then the position (from AT) is the right border of the text on the output. Same for CENTER, where the position will be the center of the text.

I know, Henrik use this dialect. What do you say? If others use this dialect, I would like to hear your opinions! If I change this in the dialect, it may mean changes to your code.

2-Jun-09 10:59
1930GeomolList of printers supporting Level 2 PostScript directly without software driver as of 2/2/1998: http://www.postscript.org/FAQs/language/node95.html20-Mar-09 11:13
1929GeomolVer. 0.4.7 of PostScript dialect incl. PDF output uploaded: http://www.fys.ku.dk/~niclasen/postscript/

- I included font widths in rebps2pdf.r instead of separate binary, and - fixed a bug.

17-Mar-09 13:40
1928GeomolI made the center- and right-alignment of text for PDF output. See Announce!16-Mar-09 13:03
1927GeomolThanks, Gabriele. I have the info to make those alignments and will probably do it next week.14-Mar-09 12:00
1926Gabrielestill... even if you just study the pdf maker you'll learn all you need about what you need to do.14-Mar-09 9:12
1925Gabrieleit needs work, it's quite slow the way it is now, and I need to redo the math as the approach I used doesn't work very well (the results are good anyway, it's just that there are too many special cases in the code).14-Mar-09 9:11
1924GabrieleYou can use metrics.bin, or you can even use my TeX based typesetter, as that is completely independent from the PDF Maker.14-Mar-09 9:10
1923Gabrieleright, font metrics. Volker wrote a script to parse the .afm files.14-Mar-09 9:09
1922GeomolSeems like you use font metrics (metrics.bin).13-Mar-09 11:03
1921Geomol:-) Do you do it using font metrics in pdf-maker, or is there another trick?13-Mar-09 10:48
1920GabrieleGeomol... code to do that has been available for like 6 years...13-Mar-09 9:08
1919GeomolThe way to do center- and right-aligned text in PDF is to get the Font Metrics like these for the 14 standard fonts (see "PDF CORE FONT INFORMATION" near the bottom): http://www.adobe.com/devnet/font/

and calculate the size of the text and then the position. For other fonts, you need similar info.

12-Mar-09 16:04
1918PekrNo problems here ...12-Mar-09 15:38
1917GeomolI updated: http://www.fys.ku.dk/~niclasen/postscript/rebps2pdf.r and http://www.fys.ku.dk/~niclasen/postscript/pdftest.pdf

How does it look now?

12-Mar-09 15:07
1916GeomolAnd I don't ... damn! Changes on the way...12-Mar-09 14:42
1915GeomolThanks, I get the error in a version 6.0. Now I have to figure out, if I stick to PDF 1.3 standard.12-Mar-09 14:33
1914Pekrversion 9.0.0 Czech ...12-Mar-09 14:32
1913GeomolPekr, what version of Adobe Reader do you have installed?12-Mar-09 14:29
1912GeomolI think, there a problem. Adobe Reader give an error "Ilegal operation 'm' inside a text object." on my PC.12-Mar-09 14:08
1911GeomolStrange, I just tried on my PC, and I get a blank page. It works on my Mac. hmm12-Mar-09 14:05
1910Pekrnow it's ok ...12-Mar-09 14:04
1909GeomolPekr, try reload it again.12-Mar-09 14:03
1908GeomolMaybe encoding? ok, I'll try change encoding. one moment...12-Mar-09 14:01
1907Pekryes, it launches in FF 3.0.412-Mar-09 14:00
1906GeomolPekr, do you try to open this? http://www.fys.ku.dk/~niclasen/postscript/pdftest.pdf12-Mar-09 13:59
1905GeomolIn PDF, the only way to get center- and right-aligned text, is to know the size of each character in the font, and then calculate the starting left position yourself. It seems, all people on the planet producing PDF does it this way: http://www.adobeforums.com/webx/.3bc3e85312-Mar-09 13:58
1904Pekrhmm, your pdf example above display dialog box with message: there is an error on this page. Acrobat may not display the content correctly. Please contact the person, who created the page to remove the problem .... (free translation from czech)12-Mar-09 13:58
1903GeomolThe more I read and learn about the PDF format, the less fond I am of it. It's a bloated mess with some critical limites, as I see it.12-Mar-09 13:55
1902GeomolAbout scaling images and physical size. I know, the image datatype only have size in pixels, and how much is a pixel on paper? It's up to the one producing the output to set that. An old measure is 72 dpi, which is 72 dots per inch. So setting this pixel-to-dot scale for images, and the image will be: (# of pixels / 72) inches in size on paper

I'm not 100% happy with the way, I've implemented the scaling of images, and suggestions are welcome.

12-Mar-09 13:52
1901GeomolI found a bug when specifying ImageMatrix in postscript.r I've fixed it and uploaded a new version. Now images should work the same in postscript.r and rebps2pdf.r12-Mar-09 13:48
1900PekrPhysical size, as in bytes? What about X*Y*4?12-Mar-09 13:47
1899HenrikAnton, that's a pretty good question.12-Mar-09 13:41
1898AntonThe image! datatype doesn't tell you. It must be asserted separately. But where, by who?12-Mar-09 5:00
1897AntonThe question is, what is the physical size of a rebol image?12-Mar-09 4:58
1896GeomolI also found, that images seems to work in a weird way with the postscript.r script producing PostScript output. I have to test this some more. For now, scaling images to 72x72 should mean images in 72 dpi. Maybe this isn't a good way to scale?12-Mar-09 2:12
1895GeomolCenter- and right-alignment of text isn't as easy in PDF as in PostScript, so this is left out. See: http://www.adobeforums.com/webx/.3bc3e85312-Mar-09 2:10
1894GeomolPDF output from the PostScript dialect is ready for some test. The script is here: http://www.fys.ku.dk/~niclasen/postscript/rebps2pdf.r

It works the same as the postscript.r script: http://www.fys.ku.dk/~niclasen/postscript/postscript.r (which has been updated, as I found some problem with comments)

Example of use:

do http://www.fys.ku.dk/~niclasen/postscript/rebps2pdf.r write/binary %pdftest.pdf rebps2pdf load http://www.fys.ku.dk/~niclasen/postscript/pdftest.txt

Now you should have a local %pdftest.pdf file, that looks like: http://www.fys.ku.dk/~niclasen/postscript/pdftest.pdf

12-Mar-09 2:09
1893GeomolMinor update of the documentation: http://www.fys.ku.dk/~niclasen/postscript/postscript.html10-Mar-09 8:31
1892GeomolOk, I just wanted to check the ways, we eventually did it. I do this:

PageSize A4 font [Times 7] page [rotate 90 translate 0x-842 ... ]

I use the offset 8x834 for the first line of text on the paper, no matter if it's landscape or not. It works.

5-Mar-09 15:09
1891HenrikAlso Ghostscript and Preview.app interpret paper orientation and size information differently. Ghostscript tends to be more correct, it seems.5-Mar-09 15:03
1890HenrikI have tried, but stopped again due to problems with determining whether the dialect itself should create a landscape document or the printer driver. So I just usually make a portrait document and rotate everything 90 degrees.5-Mar-09 14:59
1889GeomolHenrik, have you ever done landscape with the dialect?5-Mar-09 14:53
1888Henrikthanks3-Mar-09 17:38
1887GeomolSee Announce3-Mar-09 16:57
1886GeomolIt seems, if parenthesis are not balanced in a string, the output is rubbish. I found in the ref manual, that some special characters need to be escaped with: \ I've made a new version, I'll upload soon.3-Mar-09 16:50
1885HenrikI've not encountered it. What goes wrong?3-Mar-09 16:40
1884GeomolThere seems to be a problem with printing parenthesis in my postscript dialect. Henrik, I guess, you use this dialect. Did you come across this problem?

Others using this postscript dialect?

3-Mar-09 16:04
1883GabrieleThat still costs money (CPU, RAM, Flash, ...)1-Mar-09 9:34
1882RobertI thought these days, that you just plug-in an embedded Linux, use ghostscript and that's it.27-Feb-09 14:21
1881DideCMost cheap printer are dumb. The power is in the driver: the computer does the job then send raw command to the printer controller. They are often called "Winprinter" because of the usually Windows only driver they provide (well, not so true today as it used to be a few years ago).

Expensive printers include processor, RAM and the firmware to understand the print command by themself. PCL or PS ones (but it exists other languages like on Kyocera printers, I have done things for that 12 years ago).

27-Feb-09 9:38
1880Grahamall cost driven.26-Feb-09 20:17
1879GrahamMass distribution printers .. the added cost of installing a PS interpreter, ram etc.26-Feb-09 20:17
1878RobertHe, good point Graham. Whereas I don't understand what influence this has on PS interpreter...26-Feb-09 20:11
1877GrahamOfficejet sounds like an inkjet ... unlikely to have PS.26-Feb-09 20:07
1876GeomolA simple test page: http://www.fys.ku.dk/~niclasen/postscript/test.ps26-Feb-09 20:06
1875RobertI will give it a try on my OfficeJet thing. Pretty old and I'm mostly sure it won't work. Any good PS file for the test?26-Feb-09 20:02
1874GrahamMost of HP's commercial printers have embedded postscrript interpreters. It's only their home printers that don't.26-Feb-09 19:08
1873GeomolNo, if you need it, you can add it. :-)26-Feb-09 16:11
1872kib2Does the produced PostScript file contains any bounding-box (to make an eps one )?26-Feb-09 15:26
1871HenrikI managed to lock up my brothers HP Laserjet 4500 with a PDF file. That was interesting :-)26-Feb-09 15:10
1870GeomolA HP LaserJet 4000, I have access to, seem to print PS just fine without the need for a driver.26-Feb-09 15:09
1869Henrik"It could be interesting to find out, how many printers can print PS directly without a driver." <- I've not yet seen one that does. Even for postscript, there is apparently a need to adjust for bugs in the printer hardware.26-Feb-09 15:08
1868GeomolA world without printer drivers is a better world! (TM)26-Feb-09 14:56
1867GeomolIt seems, that something called IPS PS3 is in printers from HP and Xerox, so they understand PS directly: http://www.zoran.com/IPS-PS3

It could be interesting to find out, how many printers can print PS directly without a driver. Just sending to port 9100 on the printer, as described in the REBOL postscript docs.

26-Feb-09 14:55
1866HenrikI'm still working on my VID->Postscript thing. I will need it for work on a paper layout GUI later this month, so there will be some progress there.8-Feb-09 13:58
1865GeomolPostscript dialect: http://www.fys.ku.dk/~niclasen/postscript/postscript.r Documentation: http://www.fys.ku.dk/~niclasen/postscript/postscript.html Test (see also documentation): http://www.fys.ku.dk/~niclasen/postscript/test.txt8-Feb-09 13:54
1864GeomolI just realized, my postscript pages are gone with my old homepage. Moving things over to ...8-Feb-09 13:42
1863Grahamthe last one is a bar code font I use5-Dec-08 20:30
1862Graham; map postscript fonts to windows fonts fonts: [ "Bookman-Demi" "URW Bookman L Demi Bold" "Bookman-DemiItalic" "URW Bookman L Demi Bold Italic" "Bookman-Light" "URW Bookman L Light" "Bookman-LightItalic" "URW Bookman L Light Italic" "Courier" "Nimbus Mono L" "Courier-Oblique" "Nimbus Mono L Regular Oblique" "Courier-Bold" "Nimbus Mono L Bold" "Courier-BoldOblique" "Nimbus Mono L Bold Oblique" "AvantGarde-Book" "URW Gothic L Book" "AvantGarde-BookOblique" "URW Gothic L Book Oblique" "AvantGarde-Demi" "URW Gothic L Demi" "AvantGarde-DemiOblique" "URW Gothic L Demi Oblique" "Helvetica" "Nimbus Sans L" "Helvetica-Oblique" "Nimbus Sans L Regular Italic" "Helvetica-Bold" "Nimbus Sans L Bold" "Helvetica-BoldOblique" "Nimbus Sans L Bold Italic" "Helvetica-Narrow" "Nimbus Sans L Condensed" "Helvetica-Narrow-Oblique" "Nimbus Sans L Condensed Italic" "Helvetica-Narrow-Bold" "Nimbus Sans L Condensed Bold" "Helvetica-Narrow-BoldOblique" "Nimbus Sans L Condensed Bold Italic" "Palatino-Roman" "URW Palladio L Roman" "Palatino-Italic" "URW Palladio L Italic" "Palatino-Bold" "URW Palladio L Bold" "Palatino-BoldItalic" "URW Palladio L Bold Italic" "NewCenturySchlbk-Roman" "Century Schoolbook L Roman" "NewCenturySchlbk-Italic" "Century Schoolbook L Italic" "NewCenturySchlbk-Bold" "Century Schoolbook L Bold" "NewCenturySchlbk-BoldItalic" "Century Schoolbook L Bold Italic" "Times-Roman" "Nimbus Roman No9 L" "Times-Italic" "Nimbus Roman No9 L Regular Italic" "Times-Bold" "Nimbus Roman No9 L Medium" "Times-BoldItalic" "Nimbus Roman No9 L Medium Italic" "Times-BoldOblique" "Nimbus Roman No9 L Medium Italic" "Symbol" "Standard Symbols L" "ZapfChancery-MediumItalic" "URW Chancery L Medium Italic" "ZapfDingbats" "Dingbats" "free 3 of 9 regular" "FREE3OF9.TTF" ]5-Dec-08 20:29
1861GrahamLet me check to see what mapping I use ...5-Dec-08 20:28
1860Grahamand then you can map5-Dec-08 20:26
1859GrahamProbably the best thing is to ensure the user uses the PostScript TTFs in their layouts5-Dec-08 20:26
1858HenrikI think that was supposed to be some kind of font mapping which wasn't finished.5-Dec-08 20:23
1857Grahamfor Rebgui ... f/font is none5-Dec-08 20:18
1856GrahamWhich seems to say, if you have specified a font, ignore it and just use helvetica!5-Dec-08 20:18
1855Grahamthe first place it barfs in this simple layout is here

if f/font/name [append font-name 'Helvetica]

5-Dec-08 20:18
1854Henrikall to-postscript.r does is go through the layout tree and renders each object as a postscript color box with a text box on top of it. face values are just mapped into postscript.5-Dec-08 10:43
1853Henrikperhaps the layout tree is different for rebgui5-Dec-08 10:00
1852GrahamDoesn't seem to work with layouts from rebgui

>> lo2: display "Test" [ text "hello" ] >> unview/all >> type? lo2 == object! >> to-postscript lo2 ** Script Error: Cannot use path on none! value ** Where: ps-face ** Near: if f/font/name [append font-name 'Helvetica] if find

5-Dec-08 9:59
1851HenrikI'll get to know it more when we get to build a real rich text editor5-Dec-08 0:19
1850Henrikthat is possible5-Dec-08 0:18
1849Grahamprobably better if we can get the xy of each character in the text string5-Dec-08 0:16
1848Grahamso, we can do the text formmating using VID+ and take it out as a graphic5-Dec-08 0:15
1847Henrikrich text has some bugs, which cyphre is able to fix once he gets time, so I hope this will be possible to hook into. i.e. it's not a closed part that we can't touch.5-Dec-08 0:15
1846Grahameg. we can submit an area to the layout engine and get a graphic back at a specified resolution5-Dec-08 0:14
1845GrahamPehaps we need some hooks into the layout engine that allows us to extract this type of data5-Dec-08 0:12
1844HenrikThe approach would be similar, but I don't know if that information can be extracted. Perhaps it can if Cyphre is pushed hard enough. :-)5-Dec-08 0:11
1843GrahamHope Vid+ doesn't have that limitation5-Dec-08 0:10
1842Henrikbecause that is handled at the View level. text wrapping information is not available in the layout tree.5-Dec-08 0:09
1841Grahamthe ps dialect supports rebol image format5-Dec-08 0:09
1840Henrik(which is why it says wednesday twice in one of the fields in the postscript output.5-Dec-08 0:09
1839Grahamwhy not?5-Dec-08 0:09
1838Henrikno bitmap support and no wrapped text support.5-Dec-08 0:08
1837Grahamsince it works on a view object ... it should work on Rebgui as well5-Dec-08 0:08
1836Henrikif you're doing B/W stuff and not worrying too much about text wrapping, then it should work.5-Dec-08 0:08
1835Grahamclose ....5-Dec-08 0:07
1834Henrikhttp://rebol.hmkdesign.dk/files/to-postscript.r5-Dec-08 0:07
1833Henrikhttp://rebol.hmkdesign.dk/files/vid-postscript2.png5-Dec-08 0:06
1832GrahamHave you published it?5-Dec-08 0:06
1831GrahamKewl5-Dec-08 0:06
1830Henrikactually not a dialect, it just converts a View object tree to postscript. it's used in the same way as to-image is on a layout.5-Dec-08 0:05
1829GrahamHow well does it work?5-Dec-08 0:05
1828Henrikyes, I did5-Dec-08 0:04
1827GrahamYes... I know it's 1am for you!5-Dec-08 0:02
1826GrahamHenrik, did you create a dialect that takes a VID layout and produces a printout in PS?5-Dec-08 0:01
1825Henriksolved the positioning problem14-Oct-08 16:06
1824HenrikI'm very confused right now. Images now work, but are placed in the wrong corner, despite being given the same coordinates as text and boxes.14-Oct-08 15:53
1823HenrikSorry, should be:

I don't get it. The 'img variable is set to an image! type, just like it is when using load-image from a file! or url! (which I couldn't get to work either).

14-Oct-08 15:42
1822HenrikI don't get The 'img variable is set to an image! type, just like it is when using load-image from a file or url (which I couldn't get to work either).14-Oct-08 15:42
1821GeomolIt's because, an image! datatype is the sequence make image! [ ....

and that is being parsed.

14-Oct-08 15:30
1820GeomolI can't get image! datatype to work in the postscript dialect (your suggestion). If I have it as a word, that is being "get", it works.14-Oct-08 15:28
1819GeomolBest way is to test, test, test, I'm afraid.14-Oct-08 15:23
1818GeomolThe dialect code, you produce, looks ok. I'm really not a shark with PS, so it doesn't mean, it's 100%, even if it looks ok to me. :)14-Oct-08 15:23
1817GeomolI had a problem some time ago showing PS files, I produced. I think, it was some cache.14-Oct-08 15:20
1816Henrikand I've already added scaling14-Oct-08 15:18
1815Henrikinteresting that you can run the file. I can't.14-Oct-08 15:18
1814HenrikBTW, if you don't mind: I've added a probe on the dialect code output in to-postscript.r. Then you can see if I'm writing something incorrect out.14-Oct-08 15:17
1813GeomolI tried setting your factor to 72, then I can see the image, but the text is HUGE! :-)14-Oct-08 15:17
1812GeomolHenrik, I think, you need another factor. The one you have now, is set to 1. It's ok for your text. You have to put scale 72x72 (or something) when showing images.14-Oct-08 15:16
1811Henrikback in 30 mins.14-Oct-08 15:13
1810GeomolUse scale 72x72 for 72 dpi.14-Oct-08 15:12
1809Henrikwell, it still won't run the PS file.14-Oct-08 15:12
1808GeomolYes, so your image is there, it's just tiny.14-Oct-08 15:11
1807GeomolThink so. :)14-Oct-08 15:10
1806HenrikDeviceRGB is already added here. Is scale necessary?14-Oct-08 15:10
1805Henrikyes, it works14-Oct-08 15:10
1804AntonYes, I had to add DeviceRGB to see the image.14-Oct-08 15:09
1803GeomolDoes this work for you?

write %imagetest.ps postscript [DeviceRGB [translate 100x600 scale 100x100 image help.gif]]

14-Oct-08 15:08
1802HenrikThere should not be any change in my version of the image decoder.14-Oct-08 15:04
1801GeomolWith the change, I can produce a PS file, but I still can't see the image. Will try some stuff...14-Oct-08 15:03
1800GeomolAh, got it. *thinking*14-Oct-08 14:59
1799Henrikthe changes I listed above adds image! support directly..14-Oct-08 14:58
1798Henrikbecause otherwise I can't put images directly into the dialect and I will have to store them in a tempory place first and reference them with a word => much more code.14-Oct-08 14:58
1797GeomolDoesn't work with my version of postscript. Why is the image change needed?14-Oct-08 14:57
1796Henrikit was wrong. please try again.14-Oct-08 14:53
1795Henrikah wait... let me check if your version of to-postscript properly supports images14-Oct-08 14:52
1794HenrikGhostscript will not run that file here.14-Oct-08 14:51
1793Henrikyes, it should be there.14-Oct-08 14:51
1792GeomolShould I see the help.gif image too?14-Oct-08 14:51
1791GeomolWhen I run your test with my version of postscript.r, I get a page with a gray box in upper left and the text "Page 1". It's an ok PS file here.14-Oct-08 14:50
1790HenrikGeomol, the code for image that is in your version is:

image: [err: 'image set name [file! | url! | word!] ( img: either word! = type? name [get name] [load-image/update name] x: img/size/x y: img/size/y

I've changed that to:

image: [err: 'image [set img [file! | url!] (img: load-image/update img) | set img word! (img: get img) | set img image!] ( x: img/size/x y: img/size/y

14-Oct-08 14:48
1789Henrikto-postscript layout/tight [text "Page 1" image help.gif]

That's the code for it

14-Oct-08 14:44
1788Henrikhttp://rebol.hmkdesign.dk/files/test.ps

That one fails here.

14-Oct-08 14:43
1787Henrikthen we can compare14-Oct-08 14:38
1786HenrikI want to do the equivalent of what anton did above, just with to-postscript.14-Oct-08 14:38
1785GeomolOk, what do you wanna do? Anton did a little test, that worked ok. I can run the test here too.14-Oct-08 14:37
1784HenrikI remember images working fine this spring, but it does not work now. I'm wondering what's wrong.14-Oct-08 14:36
1783GeomolI mean, I haven't done anything else with it since.14-Oct-08 14:35
1782GeomolNo, same version: http://home.tiscali.dk/john.niclasen/postscript/postscript.r14-Oct-08 14:34
1781HenrikI was editing 0.4.3 from February 2008. Is yours newer?14-Oct-08 14:34
1780GeomolHenrik, I can see, there's a bit difference in our versions. Maybe we should merge at some point? Image is in both our versions though.14-Oct-08 14:33
1779HenrikGeomol, I've added direct support for image! in the postscript dialect. It seemed appropriate to do.14-Oct-08 14:07
1778Henrikthe only problem with switchy is that everything is upside down, inclusing text.14-Oct-08 13:57
1777AntonAnyway... just a little dabble in the postscript world..14-Oct-08 13:19
1776AntonHmm.. if I have offset: pagesize - img/size then it shows the image just a little left of bottom-right corner of page. Another margin ?14-Oct-08 13:17
1775Antonkghostview test-image.ps shows the help.gif image just down a little bit from the top-left of the page. I suppose it's a margin of some sort.14-Oct-08 13:13
1774Antonpagesize: 595x842 ; Default A4 page size img: help.gif offset: 0x0 write/binary %test-image.ps postscript compose/deep [DeviceRGB [translate (as-pair offset/x pagesize/y - offset/y - img/size/y) scale 36x36 image img]]14-Oct-08 13:12
1773AntonI'm just wondering what the default page size is, when it's not specified.14-Oct-08 12:50
1772AntonIt's an old document, from 2000, though...14-Oct-08 12:49
1771Anton"Do not explicitly specify paper format. Unfortunately, many programs force you to select a paper size. Often, it can be edited out of the Postscript file. Instead, let the printer decide whether it can print a document with specific dimensions."14-Oct-08 12:46
1770Anton"How to generate portable Postscript"14-Oct-08 12:46
1769Antonhttp://alumni.media.mit.edu/~szummer/postscript/14-Oct-08 12:45
1768AntonThis talks about page size.14-Oct-08 12:45
1767GeomolIn contrast to e.g. HTML, where it's up to the browser, how it'll look.14-Oct-08 12:31
1766GeomolI think, if you write code, that'll produce postscript output, you have to know the paper size. At least the last step has to know. I see postscript as a language, where you have full control over, what you get on the paper.14-Oct-08 12:30
1765GeomolThe whole page will be upside down, it seems, also the graphics. That can prob. be fixed with some transformation.14-Oct-08 12:27
1764AntonI suppose actually I should ignore the page size.14-Oct-08 12:26
1763AntonAha, that's useful for what Henrik's doing.14-Oct-08 12:25
1762GeomolYou can also use the command "switchy" to switch y-axis. See last command in the docs.14-Oct-08 12:24
1761GeomolPaper sizes in postscript: A4: 595x842 A5: 420x595 Letter: 612x79214-Oct-08 12:23
1760AntonHmm.. what's the height of the page ? I want to put the image at the top.14-Oct-08 12:22
1759GeomolI can too using Preview under OS X.14-Oct-08 12:21
1758AntonI can see the help.gif image, in colour, at the bottom of the page, using kghostview.14-Oct-08 12:20
1757Antonwrite/binary %test-image.ps postscript [DeviceRGB [translate 10x10 scale 72x72 image help.gif]]14-Oct-08 12:19
1756GeomolYeah, that's rare, isn't it! ;P14-Oct-08 12:15
1755AntonAh docs by the author.. :)14-Oct-08 12:13
1754Geomol:-) Good to see some being done in this area. If you have ideas for the postscript dialect http://home.tiscali.dk/john.niclasen/postscript/postscript.r , let me know.

Documentation: http://home.tiscali.dk/john.niclasen/postscript/postscript.html

14-Oct-08 12:13
1753Anton(Never mind the save/bmp thing.)14-Oct-08 11:43
1752AntonGeomol's dialect allows image! but you have to reference it by a word (no direct reference).14-Oct-08 11:42
1751AntonYes, it saves as a bmp bitmap in the binary specified, so no need for intermediate file.14-Oct-08 11:38
1750HenrikI was wrong. There is image! support, although this was not brought out in the dialect (strange). Problem is right now that Ghostscript refuses to display postscripts with images from to-postscripts.14-Oct-08 11:36
1749Henrikso it saves it as a bmp in memory?14-Oct-08 11:17
1748Antonfor those faces which have DRAW blocks, as a temporary measure.14-Oct-08 11:16
1747AntonSo you could use save/bmp #{} to-image face14-Oct-08 11:15
1746AntonWell we can save/bmp14-Oct-08 11:15
1745Henrikbut not image! yet14-Oct-08 11:14
1744Henrikyes, jpg, gif, bmp and I believe png is also supported.14-Oct-08 11:13
1743AntonCan you put images into postscript ?14-Oct-08 10:56
1742HenrikI don't know. I don't have the HP1200 anymore. :-)25-Jun-08 7:53
1741Grahamso does using %//prn work any better than using echo??24-Jun-08 20:43
1740Henrikanother advantage is that it's fairly simple to add a new method. it took 20 minutes to add Ghostscript printing via the win32pr driver and when it was added, I could print anything, which is a nice thing about this abstraction.24-Jun-08 14:49
1739HenrikI can release the code for you, if you're interested.24-Jun-08 14:47
1738Henrikit is largely oriented towards use on Win98/XP.24-Jun-08 14:46
1737Henrikthe downside with this system is that I'm still not using straight native windows printing. the good side is that it offers many alternative solutions for printing.24-Jun-08 14:46
1736Henrikthe first part can probably be replaced with your own stuff24-Jun-08 14:45
1735Henrikyou feed a postscript layout through a parser, which fills in dynamic values and then it's run through postscript.r and then it's fed through system-print to the appropriate printing method.24-Jun-08 14:45
1734HenrikThere is also a print queue system, which you can opt to use, if you don't want to print directly.

http://rebol.hmkdesign.dk/files/system-print-queue.png

24-Jun-08 14:43
1733HenrikIt supports currently print to file, print to LPT, print to Ghostscript, print to screen (as in screenshot), print to ethernet printer and to a custom network printer server made in REBOL for some simple printer sharing.24-Jun-08 14:42
1732Henrikhttp://rebol.hmkdesign.dk/files/system-print.png24-Jun-08 14:39
1731HenrikGeomol, I built a printer abstraction system called system-print for my apps. It's not finished, but for what it does it works sort of OK. You can choose printing method via a GUI and it auto-detects Ghostscript and uses it if necessary.24-Jun-08 14:37
1730Geomol"There are many printer specific bugs that require a windows printer driver to make postscript printing work properly"

Bad news for me! I'm working on a new version of a huge application for a customer, and I was about to rebuild their printing in a couple of months. I planned to use the rebol postscript dialect.

24-Jun-08 14:29
1729Grahamghostscript can generate pcl from postscript ... and then you can feed it to the driver24-Jun-08 12:21
1728Henrikif anything, perhaps that process is faster24-Jun-08 12:20
1727Grahamas opposed to sending PCL to the printer... well, that is my guess24-Jun-08 12:20
1726Grahamthe HP driver probably takes PCL and creates a bitmap and then sends it to the printer24-Jun-08 12:20
1725Henrikit might not24-Jun-08 12:18
1724GrahamMy guess is that it doesn't have any PCL engine on boad.24-Jun-08 12:18
1723Grahamtake the printer output and send it directly to the printer if you can .. see what happens24-Jun-08 12:18
1722Grahamsetup a HP printer ( eg an old laserjet ) and set the driver to print to a file24-Jun-08 12:17
1721Henrikand a new PC. that stupid machine just died. glorious day today.24-Jun-08 12:17
1720Henrikhmm... need some examples for that.24-Jun-08 12:17
1719Grahamwith a PCL driver24-Jun-08 12:17
1718GrahamIf it doesn't understand it .. then it's just a dumb printer24-Jun-08 12:16
1717Grahamtry sending some raw PCL to the printer to see what happens24-Jun-08 12:16
1716Henrikwell, as long as this one is.. :-)24-Jun-08 12:15
1715Grahamno24-Jun-08 12:15
1714Henrikyes it is. I think all HP printers are.24-Jun-08 12:14
1713Grahamthe product description says that the HHP 1505 is a host based PCL printer24-Jun-08 12:14
1712Henrikif it can that makes my task simpler.24-Jun-08 12:14
1711HenrikI did not know that.24-Jun-08 12:13
1710GrahamSince the printer driver is host based, it would be doing the same thing as well.24-Jun-08 12:05
1709Grahamand then you can dump the resulting prn file to the printer vs creating a bitmap??24-Jun-08 12:03
1708GrahamYou do know that ghostscript can convert ps to pcl ??24-Jun-08 12:03
1707Grahamdo you need to print as soon as possible?24-Jun-08 12:00
1706Henrikyes, I don't expect it to be as fast as PS, but this is like... 25-50 times slower. :-)24-Jun-08 11:56
1705Grahamso it will always be slower than a PS printe.24-Jun-08 11:55
1704Henriknow if they stopped that winprinter crap and had postscript as standard in all printers... the hardware to do that should be fairly cheap for that today.24-Jun-08 11:55
1703Grahamcheap host based printer24-Jun-08 11:55
1702Henrikyeah :-(24-Jun-08 11:54
1701Henrikit seems gsprint provides many more options... I will have to investigate that.24-Jun-08 11:54
1700Grahamyou need to create a PCL driver :)24-Jun-08 11:54
1699Henrikmine and budget. we can't afford a better printer.24-Jun-08 11:53
1698Grahamwho's decision was it to purchase that?24-Jun-08 11:53
1697Henrikwell, the bitmap it sends is over 2 MB in size. that's pretty huge for a pure b/w bitmap I think.24-Jun-08 11:53
1696HenrikHP Laserjet 1505.24-Jun-08 11:52
1695Grahamwhat printer do you have now?24-Jun-08 11:52
1694Grahamfaster PC24-Jun-08 11:52
1693Henrikthe only problem is the speed. I really wish I could speed it up.24-Jun-08 11:51
1692Henriknow with a new printer, I have to create a completely different setup with ghostscript.24-Jun-08 11:51
1691Grahamwell, then there is very little option except to use ghostscript24-Jun-08 11:51
1690HenrikI ranted about it, because I could not print directly to it, but had to use the adobe driver for that.24-Jun-08 11:50
1689Henriksorry if I confused you. no the HP1200 one is no longer being used24-Jun-08 11:50
1688Grahamthe HP 1200 ?24-Jun-08 11:49
1687GrahamHuh??24-Jun-08 11:49
1686Henrikthe problem is that the new printer is not a postscript printer.24-Jun-08 11:49
1685Grahamwell, if the way you're doing it now is not working ... I suggest you try my ways :)24-Jun-08 11:48
1684Henrikit's a confusing subject, because there are 20 different ways to print :-)24-Jun-08 11:48
1683Grahamso might fix your problems as well.24-Jun-08 11:46
1682GrahamMaybe this is even going thru the windows printer driver24-Jun-08 11:46
1681Grahamand so %//prn will still work ...24-Jun-08 11:43
1680Grahamthis is what I had to do for usb printers .. http://synapsedirect.com/forums/thread/396.aspx24-Jun-08 11:41
1679HenrikI've been informed that we are not using win98 anymore (yay!)24-Jun-08 11:40
1678Grahamit might not work under Windows 9824-Jun-08 11:38
1677Henrikso %prn is a DOS/win32 thing that REBOL just uses?24-Jun-08 11:36
1676Grahamfrom Andrew Martin

Printer: func [Text [string!] /Page] [ secure [ %//prn [allow write] ] write %//prn Text ; Append Carriage Return (CR) and Page Feed. if Page [write/binary %//prn "^(0D)^(page)"] Text ]

24-Jun-08 11:34
1675Graham%//lpt1 is also possible, but according to google, %//prn diverts to the first availabel printer24-Jun-08 11:33
1674Henrikinteresting... but ok, now my focus is to make it work on any printer. as mentioned it is fed through ghostscript. when I read about GSPrint it almost seems like it does the same thing. it even uses the same driver.24-Jun-08 11:31
1673GrahamBut never had a problem24-Jun-08 11:30
1672Grahamdunno24-Jun-08 11:30
1671Henrikinteresting... what decides that %//prn is LPT1?24-Jun-08 11:30
1670Grahamwhen printing to lpt124-Jun-08 11:29
1669Grahamthis is what I do ...

write %//prn content

24-Jun-08 11:29
1668HenrikI just echo'ed it through DOS to LPT1:.24-Jun-08 11:28
1667Grahamwhat was your code to send the ps to the printer??24-Jun-08 11:27
1666Henrikand I tried both with similar results24-Jun-08 11:27
1665Henrikit can use both.24-Jun-08 11:27
1664Grahamparallel or usb?24-Jun-08 11:27
1663HenrikHP Laserjet 120024-Jun-08 11:26
1662Grahamand which were you using?24-Jun-08 11:26
1661HenrikIt uses parallel/usb24-Jun-08 11:26
1660Grahamwhat sort of printer is it??24-Jun-08 11:25
1659GrahamI got some notes somewhere that async printing to a postscript printer caused me problems.24-Jun-08 11:25
1658Henrikdoesn't that only work for ethernet printers?24-Jun-08 11:25
1657Grahamso, you just writing to port 9100 ?24-Jun-08 11:20
1656Henriknope24-Jun-08 11:19

Return to Index Page