# | User | Message | Date |
1955 | Maxim | get-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 |
1954 | Henrik | It's a little annoying having only a 1-2 week window a year to work with postscript. | 2-Jun-09 13:01 |
1953 | Henrik | Geomol, 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 |
1952 | Maxim | the function is called get-word-wrap in the glayout lib (on rebol.org) | 2-Jun-09 12:56 |
1951 | Geomol | Do 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 |
1950 | Henrik | Geomol, I guess it doesn't harm layout capabilities. | 2-Jun-09 12:54 |
1949 | Henrik | this will be useful when I will get to finish the function, perhaps in a month or so. | 2-Jun-09 12:53 |
1948 | Maxim | you can use it to wordwrap draw text too. | 2-Jun-09 12:53 |
1947 | Maxim | yes. | 2-Jun-09 12:52 |
1946 | Maxim | I was using it specifically to build HUGE tables (300000cells) and its deadly fast. | 2-Jun-09 12:52 |
1945 | Henrik | Maxim, so they will be identical to what is seen in View instead of DRAW? | 2-Jun-09 12:52 |
1944 | Maxim | glayout wordwrap functions uses the internal view commands which calculate word-wrap. | 2-Jun-09 12:51 |
1943 | Geomol | I like the second way better. | 2-Jun-09 12:49 |
1942 | Geomol | at 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 |
1941 | Geomol | It 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 |
1940 | Henrik | oops, size marker, not position marker | 2-Jun-09 12:46 |
1939 | Henrik | if you drop the position marker, will it be simpler or harder to build formatted tables? | 2-Jun-09 12:46 |
1938 | Henrik | http://rebol.hmkdesign.dk/files/vid-postscript2.png | 2-Jun-09 12:43 |
1937 | Geomol | hm, 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 |
1936 | Henrik | interesting. how does it work? | 2-Jun-09 12:43 |
1935 | Maxim | there is VID manual word-wrapping code in glayout lib if you need it. | 2-Jun-09 12:42 |
1934 | Henrik | it does not do word wrapping however. that's a problem that I've not yet solved. | 2-Jun-09 12:37 |
1933 | Henrik | Geomol, did you try my VID->postscript conversion function? It might be able to do some of what you need. | 2-Jun-09 12:37 |
1932 | Geomol | Because 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 |
1931 | Geomol | I'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 |
1930 | Geomol | List of printers supporting Level 2 PostScript directly without software driver as of 2/2/1998: http://www.postscript.org/FAQs/language/node95.html | 20-Mar-09 11:13 |
1929 | Geomol | Ver. 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 |
1928 | Geomol | I made the center- and right-alignment of text for PDF output. See Announce! | 16-Mar-09 13:03 |
1927 | Geomol | Thanks, Gabriele. I have the info to make those alignments and will probably do it next week. | 14-Mar-09 12:00 |
1926 | Gabriele | still... 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 |
1925 | Gabriele | it 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 |
1924 | Gabriele | You 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 |
1923 | Gabriele | right, font metrics. Volker wrote a script to parse the .afm files. | 14-Mar-09 9:09 |
1922 | Geomol | Seems like you use font metrics (metrics.bin). | 13-Mar-09 11:03 |
1921 | Geomol | :-) Do you do it using font metrics in pdf-maker, or is there another trick? | 13-Mar-09 10:48 |
1920 | Gabriele | Geomol... code to do that has been available for like 6 years... | 13-Mar-09 9:08 |
1919 | Geomol | The 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 |
1918 | Pekr | No problems here ... | 12-Mar-09 15:38 |
1917 | Geomol | I 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 |
1916 | Geomol | And I don't ... damn! Changes on the way... | 12-Mar-09 14:42 |
1915 | Geomol | Thanks, 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 |
1914 | Pekr | version 9.0.0 Czech ... | 12-Mar-09 14:32 |
1913 | Geomol | Pekr, what version of Adobe Reader do you have installed? | 12-Mar-09 14:29 |
1912 | Geomol | I think, there a problem. Adobe Reader give an error "Ilegal operation 'm' inside a text object." on my PC. | 12-Mar-09 14:08 |
1911 | Geomol | Strange, I just tried on my PC, and I get a blank page. It works on my Mac. hmm | 12-Mar-09 14:05 |
1910 | Pekr | now it's ok ... | 12-Mar-09 14:04 |
1909 | Geomol | Pekr, try reload it again. | 12-Mar-09 14:03 |
1908 | Geomol | Maybe encoding? ok, I'll try change encoding. one moment... | 12-Mar-09 14:01 |
1907 | Pekr | yes, it launches in FF 3.0.4 | 12-Mar-09 14:00 |
1906 | Geomol | Pekr, do you try to open this? http://www.fys.ku.dk/~niclasen/postscript/pdftest.pdf | 12-Mar-09 13:59 |
1905 | Geomol | In 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/.3bc3e853 | 12-Mar-09 13:58 |
1904 | Pekr | hmm, 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 |
1903 | Geomol | The 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 |
1902 | Geomol | About 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 |
1901 | Geomol | I 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.r | 12-Mar-09 13:48 |
1900 | Pekr | Physical size, as in bytes? What about X*Y*4? | 12-Mar-09 13:47 |
1899 | Henrik | Anton, that's a pretty good question. | 12-Mar-09 13:41 |
1898 | Anton | The image! datatype doesn't tell you. It must be asserted separately. But where, by who? | 12-Mar-09 5:00 |
1897 | Anton | The question is, what is the physical size of a rebol image? | 12-Mar-09 4:58 |
1896 | Geomol | I 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 |
1895 | Geomol | Center- 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/.3bc3e853 | 12-Mar-09 2:10 |
1894 | Geomol | PDF 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 |
1893 | Geomol | Minor update of the documentation: http://www.fys.ku.dk/~niclasen/postscript/postscript.html | 10-Mar-09 8:31 |
1892 | Geomol | Ok, 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 |
1891 | Henrik | Also Ghostscript and Preview.app interpret paper orientation and size information differently. Ghostscript tends to be more correct, it seems. | 5-Mar-09 15:03 |
1890 | Henrik | I 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 |
1889 | Geomol | Henrik, have you ever done landscape with the dialect? | 5-Mar-09 14:53 |
1888 | Henrik | thanks | 3-Mar-09 17:38 |
1887 | Geomol | See Announce | 3-Mar-09 16:57 |
1886 | Geomol | It 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 |
1885 | Henrik | I've not encountered it. What goes wrong? | 3-Mar-09 16:40 |
1884 | Geomol | There 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 |
1883 | Gabriele | That still costs money (CPU, RAM, Flash, ...) | 1-Mar-09 9:34 |
1882 | Robert | I thought these days, that you just plug-in an embedded Linux, use ghostscript and that's it. | 27-Feb-09 14:21 |
1881 | DideC | Most 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 |
1880 | Graham | all cost driven. | 26-Feb-09 20:17 |
1879 | Graham | Mass distribution printers .. the added cost of installing a PS interpreter, ram etc. | 26-Feb-09 20:17 |
1878 | Robert | He, good point Graham. Whereas I don't understand what influence this has on PS interpreter... | 26-Feb-09 20:11 |
1877 | Graham | Officejet sounds like an inkjet ... unlikely to have PS. | 26-Feb-09 20:07 |
1876 | Geomol | A simple test page: http://www.fys.ku.dk/~niclasen/postscript/test.ps | 26-Feb-09 20:06 |
1875 | Robert | I 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 |
1874 | Graham | Most of HP's commercial printers have embedded postscrript interpreters. It's only their home printers that don't. | 26-Feb-09 19:08 |
1873 | Geomol | No, if you need it, you can add it. :-) | 26-Feb-09 16:11 |
1872 | kib2 | Does the produced PostScript file contains any bounding-box (to make an eps one )? | 26-Feb-09 15:26 |
1871 | Henrik | I managed to lock up my brothers HP Laserjet 4500 with a PDF file. That was interesting :-) | 26-Feb-09 15:10 |
1870 | Geomol | A HP LaserJet 4000, I have access to, seem to print PS just fine without the need for a driver. | 26-Feb-09 15:09 |
1869 | Henrik | "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 |
1868 | Geomol | A world without printer drivers is a better world! (TM) | 26-Feb-09 14:56 |
1867 | Geomol | It 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 |
1866 | Henrik | I'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 |
1865 | Geomol | Postscript 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.txt | 8-Feb-09 13:54 |
1864 | Geomol | I just realized, my postscript pages are gone with my old homepage. Moving things over to ... | 8-Feb-09 13:42 |
1863 | Graham | the last one is a bar code font I use | 5-Dec-08 20:30 |
1862 | Graham | ; 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 |
1861 | Graham | Let me check to see what mapping I use ... | 5-Dec-08 20:28 |
1860 | Graham | and then you can map | 5-Dec-08 20:26 |
1859 | Graham | Probably the best thing is to ensure the user uses the PostScript TTFs in their layouts | 5-Dec-08 20:26 |
1858 | Henrik | I think that was supposed to be some kind of font mapping which wasn't finished. | 5-Dec-08 20:23 |
1857 | Graham | for Rebgui ... f/font is none | 5-Dec-08 20:18 |
1856 | Graham | Which seems to say, if you have specified a font, ignore it and just use helvetica! | 5-Dec-08 20:18 |
1855 | Graham | the first place it barfs in this simple layout is here if f/font/name [append font-name 'Helvetica] | 5-Dec-08 20:18 |
1854 | Henrik | all 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 |
1853 | Henrik | perhaps the layout tree is different for rebgui | 5-Dec-08 10:00 |
1852 | Graham | Doesn'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 |
1851 | Henrik | I'll get to know it more when we get to build a real rich text editor | 5-Dec-08 0:19 |
1850 | Henrik | that is possible | 5-Dec-08 0:18 |
1849 | Graham | probably better if we can get the xy of each character in the text string | 5-Dec-08 0:16 |
1848 | Graham | so, we can do the text formmating using VID+ and take it out as a graphic | 5-Dec-08 0:15 |
1847 | Henrik | rich 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 |
1846 | Graham | eg. we can submit an area to the layout engine and get a graphic back at a specified resolution | 5-Dec-08 0:14 |
1845 | Graham | Pehaps we need some hooks into the layout engine that allows us to extract this type of data | 5-Dec-08 0:12 |
1844 | Henrik | The 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 |
1843 | Graham | Hope Vid+ doesn't have that limitation | 5-Dec-08 0:10 |
1842 | Henrik | because that is handled at the View level. text wrapping information is not available in the layout tree. | 5-Dec-08 0:09 |
1841 | Graham | the ps dialect supports rebol image format | 5-Dec-08 0:09 |
1840 | Henrik | (which is why it says wednesday twice in one of the fields in the postscript output. | 5-Dec-08 0:09 |
1839 | Graham | why not? | 5-Dec-08 0:09 |
1838 | Henrik | no bitmap support and no wrapped text support. | 5-Dec-08 0:08 |
1837 | Graham | since it works on a view object ... it should work on Rebgui as well | 5-Dec-08 0:08 |
1836 | Henrik | if you're doing B/W stuff and not worrying too much about text wrapping, then it should work. | 5-Dec-08 0:08 |
1835 | Graham | close .... | 5-Dec-08 0:07 |
1834 | Henrik | http://rebol.hmkdesign.dk/files/to-postscript.r | 5-Dec-08 0:07 |
1833 | Henrik | http://rebol.hmkdesign.dk/files/vid-postscript2.png | 5-Dec-08 0:06 |
1832 | Graham | Have you published it? | 5-Dec-08 0:06 |
1831 | Graham | Kewl | 5-Dec-08 0:06 |
1830 | Henrik | actually 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 |
1829 | Graham | How well does it work? | 5-Dec-08 0:05 |
1828 | Henrik | yes, I did | 5-Dec-08 0:04 |
1827 | Graham | Yes... I know it's 1am for you! | 5-Dec-08 0:02 |
1826 | Graham | Henrik, did you create a dialect that takes a VID layout and produces a printout in PS? | 5-Dec-08 0:01 |
1825 | Henrik | solved the positioning problem | 14-Oct-08 16:06 |
1824 | Henrik | I'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 |
1823 | Henrik | Sorry, 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 |
1822 | Henrik | I 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 |
1821 | Geomol | It's because, an image! datatype is the sequence
make image! [ .... and that is being parsed. | 14-Oct-08 15:30 |
1820 | Geomol | I 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 |
1819 | Geomol | Best way is to test, test, test, I'm afraid. | 14-Oct-08 15:23 |
1818 | Geomol | The 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 |
1817 | Geomol | I had a problem some time ago showing PS files, I produced. I think, it was some cache. | 14-Oct-08 15:20 |
1816 | Henrik | and I've already added scaling | 14-Oct-08 15:18 |
1815 | Henrik | interesting that you can run the file. I can't. | 14-Oct-08 15:18 |
1814 | Henrik | BTW, 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 |
1813 | Geomol | I tried setting your factor to 72, then I can see the image, but the text is HUGE! :-) | 14-Oct-08 15:17 |
1812 | Geomol | Henrik, 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 |
1811 | Henrik | back in 30 mins. | 14-Oct-08 15:13 |
1810 | Geomol | Use scale 72x72 for 72 dpi. | 14-Oct-08 15:12 |
1809 | Henrik | well, it still won't run the PS file. | 14-Oct-08 15:12 |
1808 | Geomol | Yes, so your image is there, it's just tiny. | 14-Oct-08 15:11 |
1807 | Geomol | Think so. :) | 14-Oct-08 15:10 |
1806 | Henrik | DeviceRGB is already added here. Is scale necessary? | 14-Oct-08 15:10 |
1805 | Henrik | yes, it works | 14-Oct-08 15:10 |
1804 | Anton | Yes, I had to add DeviceRGB to see the image. | 14-Oct-08 15:09 |
1803 | Geomol | Does this work for you? write %imagetest.ps postscript [DeviceRGB [translate 100x600 scale 100x100 image help.gif]] | 14-Oct-08 15:08 |
1802 | Henrik | There should not be any change in my version of the image decoder. | 14-Oct-08 15:04 |
1801 | Geomol | With 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 |
1800 | Geomol | Ah, got it. *thinking* | 14-Oct-08 14:59 |
1799 | Henrik | the changes I listed above adds image! support directly.. | 14-Oct-08 14:58 |
1798 | Henrik | because 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 |
1797 | Geomol | Doesn't work with my version of postscript. Why is the image change needed? | 14-Oct-08 14:57 |
1796 | Henrik | it was wrong. please try again. | 14-Oct-08 14:53 |
1795 | Henrik | ah wait... let me check if your version of to-postscript properly supports images | 14-Oct-08 14:52 |
1794 | Henrik | Ghostscript will not run that file here. | 14-Oct-08 14:51 |
1793 | Henrik | yes, it should be there. | 14-Oct-08 14:51 |
1792 | Geomol | Should I see the help.gif image too? | 14-Oct-08 14:51 |
1791 | Geomol | When 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 |
1790 | Henrik | Geomol, 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 |
1789 | Henrik | to-postscript layout/tight [text "Page 1" image help.gif] That's the code for it | 14-Oct-08 14:44 |
1788 | Henrik | http://rebol.hmkdesign.dk/files/test.ps That one fails here. | 14-Oct-08 14:43 |
1787 | Henrik | then we can compare | 14-Oct-08 14:38 |
1786 | Henrik | I want to do the equivalent of what anton did above, just with to-postscript. | 14-Oct-08 14:38 |
1785 | Geomol | Ok, 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 |
1784 | Henrik | I remember images working fine this spring, but it does not work now. I'm wondering what's wrong. | 14-Oct-08 14:36 |
1783 | Geomol | I mean, I haven't done anything else with it since. | 14-Oct-08 14:35 |
1782 | Geomol | No, same version: http://home.tiscali.dk/john.niclasen/postscript/postscript.r | 14-Oct-08 14:34 |
1781 | Henrik | I was editing 0.4.3 from February 2008. Is yours newer? | 14-Oct-08 14:34 |
1780 | Geomol | Henrik, 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 |
1779 | Henrik | Geomol, I've added direct support for image! in the postscript dialect. It seemed appropriate to do. | 14-Oct-08 14:07 |
1778 | Henrik | the only problem with switchy is that everything is upside down, inclusing text. | 14-Oct-08 13:57 |
1777 | Anton | Anyway... just a little dabble in the postscript world.. | 14-Oct-08 13:19 |
1776 | Anton | Hmm.. 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 |
1775 | Anton | kghostview 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 |
1774 | Anton | pagesize: 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 |
1773 | Anton | I'm just wondering what the default page size is, when it's not specified. | 14-Oct-08 12:50 |
1772 | Anton | It's an old document, from 2000, though... | 14-Oct-08 12:49 |
1771 | Anton | "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 |
1770 | Anton | "How to generate portable Postscript" | 14-Oct-08 12:46 |
1769 | Anton | http://alumni.media.mit.edu/~szummer/postscript/ | 14-Oct-08 12:45 |
1768 | Anton | This talks about page size. | 14-Oct-08 12:45 |
1767 | Geomol | In contrast to e.g. HTML, where it's up to the browser, how it'll look. | 14-Oct-08 12:31 |
1766 | Geomol | I 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 |
1765 | Geomol | The whole page will be upside down, it seems, also the graphics. That can prob. be fixed with some transformation. | 14-Oct-08 12:27 |
1764 | Anton | I suppose actually I should ignore the page size. | 14-Oct-08 12:26 |
1763 | Anton | Aha, that's useful for what Henrik's doing. | 14-Oct-08 12:25 |
1762 | Geomol | You can also use the command "switchy" to switch y-axis. See last command in the docs. | 14-Oct-08 12:24 |
1761 | Geomol | Paper sizes in postscript: A4: 595x842 A5: 420x595 Letter: 612x792 | 14-Oct-08 12:23 |
1760 | Anton | Hmm.. what's the height of the page ? I want to put the image at the top. | 14-Oct-08 12:22 |
1759 | Geomol | I can too using Preview under OS X. | 14-Oct-08 12:21 |
1758 | Anton | I can see the help.gif image, in colour, at the bottom of the page, using kghostview. | 14-Oct-08 12:20 |
1757 | Anton | write/binary %test-image.ps postscript [DeviceRGB [translate 10x10 scale 72x72 image help.gif]] | 14-Oct-08 12:19 |
1756 | Geomol | Yeah, that's rare, isn't it! ;P | 14-Oct-08 12:15 |
1755 | Anton | Ah docs by the author.. :) | 14-Oct-08 12:13 |
1754 | Geomol | :-) 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 |
1753 | Anton | (Never mind the save/bmp thing.) | 14-Oct-08 11:43 |
1752 | Anton | Geomol's dialect allows image! but you have to reference it by a word (no direct reference). | 14-Oct-08 11:42 |
1751 | Anton | Yes, it saves as a bmp bitmap in the binary specified, so no need for intermediate file. | 14-Oct-08 11:38 |
1750 | Henrik | I 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 |
1749 | Henrik | so it saves it as a bmp in memory? | 14-Oct-08 11:17 |
1748 | Anton | for those faces which have DRAW blocks, as a temporary measure. | 14-Oct-08 11:16 |
1747 | Anton | So you could use save/bmp #{} to-image face | 14-Oct-08 11:15 |
1746 | Anton | Well we can save/bmp | 14-Oct-08 11:15 |
1745 | Henrik | but not image! yet | 14-Oct-08 11:14 |
1744 | Henrik | yes, jpg, gif, bmp and I believe png is also supported. | 14-Oct-08 11:13 |
1743 | Anton | Can you put images into postscript ? | 14-Oct-08 10:56 |
1742 | Henrik | I don't know. I don't have the HP1200 anymore. :-) | 25-Jun-08 7:53 |
1741 | Graham | so does using %//prn work any better than using echo?? | 24-Jun-08 20:43 |
1740 | Henrik | another 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 |
1739 | Henrik | I can release the code for you, if you're interested. | 24-Jun-08 14:47 |
1738 | Henrik | it is largely oriented towards use on Win98/XP. | 24-Jun-08 14:46 |
1737 | Henrik | the 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 |
1736 | Henrik | the first part can probably be replaced with your own stuff | 24-Jun-08 14:45 |
1735 | Henrik | you 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 |
1734 | Henrik | There 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 |
1733 | Henrik | It 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 |
1732 | Henrik | http://rebol.hmkdesign.dk/files/system-print.png | 24-Jun-08 14:39 |
1731 | Henrik | Geomol, 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 |
1730 | Geomol | "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 |
1729 | Graham | ghostscript can generate pcl from postscript ... and then you can feed it to the driver | 24-Jun-08 12:21 |
1728 | Henrik | if anything, perhaps that process is faster | 24-Jun-08 12:20 |
1727 | Graham | as opposed to sending PCL to the printer... well, that is my guess | 24-Jun-08 12:20 |
1726 | Graham | the HP driver probably takes PCL and creates a bitmap and then sends it to the printer | 24-Jun-08 12:20 |
1725 | Henrik | it might not | 24-Jun-08 12:18 |
1724 | Graham | My guess is that it doesn't have any PCL engine on boad. | 24-Jun-08 12:18 |
1723 | Graham | take the printer output and send it directly to the printer if you can .. see what happens | 24-Jun-08 12:18 |
1722 | Graham | setup a HP printer ( eg an old laserjet ) and set the driver to print to a file | 24-Jun-08 12:17 |
1721 | Henrik | and a new PC. that stupid machine just died. glorious day today. | 24-Jun-08 12:17 |
1720 | Henrik | hmm... need some examples for that. | 24-Jun-08 12:17 |
1719 | Graham | with a PCL driver | 24-Jun-08 12:17 |
1718 | Graham | If it doesn't understand it .. then it's just a dumb printer | 24-Jun-08 12:16 |
1717 | Graham | try sending some raw PCL to the printer to see what happens | 24-Jun-08 12:16 |
1716 | Henrik | well, as long as this one is.. :-) | 24-Jun-08 12:15 |
1715 | Graham | no | 24-Jun-08 12:15 |
1714 | Henrik | yes it is. I think all HP printers are. | 24-Jun-08 12:14 |
1713 | Graham | the product description says that the HHP 1505 is a host based PCL printer | 24-Jun-08 12:14 |
1712 | Henrik | if it can that makes my task simpler. | 24-Jun-08 12:14 |
1711 | Henrik | I did not know that. | 24-Jun-08 12:13 |
1710 | Graham | Since the printer driver is host based, it would be doing the same thing as well. | 24-Jun-08 12:05 |
1709 | Graham | and then you can dump the resulting prn file to the printer vs creating a bitmap?? | 24-Jun-08 12:03 |
1708 | Graham | You do know that ghostscript can convert ps to pcl ?? | 24-Jun-08 12:03 |
1707 | Graham | do you need to print as soon as possible? | 24-Jun-08 12:00 |
1706 | Henrik | yes, I don't expect it to be as fast as PS, but this is like... 25-50 times slower. :-) | 24-Jun-08 11:56 |
1705 | Graham | so it will always be slower than a PS printe. | 24-Jun-08 11:55 |
1704 | Henrik | now 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 |
1703 | Graham | cheap host based printer | 24-Jun-08 11:55 |
1702 | Henrik | yeah :-( | 24-Jun-08 11:54 |
1701 | Henrik | it seems gsprint provides many more options... I will have to investigate that. | 24-Jun-08 11:54 |
1700 | Graham | you need to create a PCL driver :) | 24-Jun-08 11:54 |
1699 | Henrik | mine and budget. we can't afford a better printer. | 24-Jun-08 11:53 |
1698 | Graham | who's decision was it to purchase that? | 24-Jun-08 11:53 |
1697 | Henrik | well, 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 |
1696 | Henrik | HP Laserjet 1505. | 24-Jun-08 11:52 |
1695 | Graham | what printer do you have now? | 24-Jun-08 11:52 |
1694 | Graham | faster PC | 24-Jun-08 11:52 |
1693 | Henrik | the only problem is the speed. I really wish I could speed it up. | 24-Jun-08 11:51 |
1692 | Henrik | now with a new printer, I have to create a completely different setup with ghostscript. | 24-Jun-08 11:51 |
1691 | Graham | well, then there is very little option except to use ghostscript | 24-Jun-08 11:51 |
1690 | Henrik | I 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 |
1689 | Henrik | sorry if I confused you. no the HP1200 one is no longer being used | 24-Jun-08 11:50 |
1688 | Graham | the HP 1200 ? | 24-Jun-08 11:49 |
1687 | Graham | Huh?? | 24-Jun-08 11:49 |
1686 | Henrik | the problem is that the new printer is not a postscript printer. | 24-Jun-08 11:49 |
1685 | Graham | well, if the way you're doing it now is not working ... I suggest you try my ways :) | 24-Jun-08 11:48 |
1684 | Henrik | it's a confusing subject, because there are 20 different ways to print :-) | 24-Jun-08 11:48 |
1683 | Graham | so might fix your problems as well. | 24-Jun-08 11:46 |
1682 | Graham | Maybe this is even going thru the windows printer driver | 24-Jun-08 11:46 |
1681 | Graham | and so %//prn will still work ... | 24-Jun-08 11:43 |
1680 | Graham | this is what I had to do for usb printers .. http://synapsedirect.com/forums/thread/396.aspx | 24-Jun-08 11:41 |
1679 | Henrik | I've been informed that we are not using win98 anymore (yay!) | 24-Jun-08 11:40 |
1678 | Graham | it might not work under Windows 98 | 24-Jun-08 11:38 |
1677 | Henrik | so %prn is a DOS/win32 thing that REBOL just uses? | 24-Jun-08 11:36 |
1676 | Graham | from 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 |
1675 | Graham | %//lpt1 is also possible, but according to google, %//prn diverts to the first availabel printer | 24-Jun-08 11:33 |
1674 | Henrik | interesting... 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 |
1673 | Graham | But never had a problem | 24-Jun-08 11:30 |
1672 | Graham | dunno | 24-Jun-08 11:30 |
1671 | Henrik | interesting... what decides that %//prn is LPT1? | 24-Jun-08 11:30 |
1670 | Graham | when printing to lpt1 | 24-Jun-08 11:29 |
1669 | Graham | this is what I do ... write %//prn content | 24-Jun-08 11:29 |
1668 | Henrik | I just echo'ed it through DOS to LPT1:. | 24-Jun-08 11:28 |
1667 | Graham | what was your code to send the ps to the printer?? | 24-Jun-08 11:27 |
1666 | Henrik | and I tried both with similar results | 24-Jun-08 11:27 |
1665 | Henrik | it can use both. | 24-Jun-08 11:27 |
1664 | Graham | parallel or usb? | 24-Jun-08 11:27 |
1663 | Henrik | HP Laserjet 1200 | 24-Jun-08 11:26 |
1662 | Graham | and which were you using? | 24-Jun-08 11:26 |
1661 | Henrik | It uses parallel/usb | 24-Jun-08 11:26 |
1660 | Graham | what sort of printer is it?? | 24-Jun-08 11:25 |
1659 | Graham | I got some notes somewhere that async printing to a postscript printer caused me problems. | 24-Jun-08 11:25 |
1658 | Henrik | doesn't that only work for ethernet printers? | 24-Jun-08 11:25 |
1657 | Graham | so, you just writing to port 9100 ? | 24-Jun-08 11:20 |
1656 | Henrik | nope | 24-Jun-08 11:19 |