Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.postscript > #3286 > unrolled thread
| Started by | John Forkosh <forkosh@panix.com> |
|---|---|
| First post | 2018-08-02 15:33 +0000 |
| Last post | 2018-08-21 09:07 +0000 |
| Articles | 12 — 5 participants |
Back to article view | Back to comp.lang.postscript
ps viewer, like ViewerJS, that can embed an <iframe> in an html page John Forkosh <forkosh@panix.com> - 2018-08-02 15:33 +0000
Re: ps viewer, like ViewerJS, that can embed an <iframe> in an html page John Reiser <vendor@BitWagon.com> - 2018-08-03 16:59 -0700
Re: ps viewer, like ViewerJS, that can embed an <iframe> in an html page John Forkosh <forkosh@panix.com> - 2018-08-04 09:08 +0000
Re: ps viewer, like ViewerJS, that can embed an <iframe> in an html page luser droog <luser.droog@gmail.com> - 2018-08-04 07:10 -0700
Re: ps viewer, like ViewerJS, that can embed an <iframe> in an html page John Forkosh <forkosh@panix.com> - 2018-08-04 15:17 +0000
Re: ps viewer, like ViewerJS, that can embed an <iframe> in an html page Eli the Bearded <*@eli.users.panix.com> - 2018-08-04 23:59 +0000
Re: ps viewer, like ViewerJS, that can embed an <iframe> in an html page John Forkosh <forkosh@panix.com> - 2018-08-05 08:30 +0000
Re: ps viewer, like ViewerJS, that can embed an <iframe> in an html page John Forkosh <forkosh@panix.com> - 2018-08-05 07:58 +0000
Re: ps viewer, like ViewerJS, that can embed an <iframe> in an html page Jean-Francois Moine <moinejf@free.fr> - 2018-08-17 18:36 +0200
Re: ps viewer, like ViewerJS, that can embed an <iframe> in an html page John Forkosh <forkosh@panix.com> - 2018-08-18 12:51 +0000
Re: ps viewer, like ViewerJS, that can embed an <iframe> in an html page Jean-Francois Moine <moinejf@free.fr> - 2018-08-18 20:22 +0200
Re: ps viewer, like ViewerJS, that can embed an <iframe> in an html page John Forkosh <forkosh@panix.com> - 2018-08-21 09:07 +0000
| From | John Forkosh <forkosh@panix.com> |
|---|---|
| Date | 2018-08-02 15:33 +0000 |
| Subject | ps viewer, like ViewerJS, that can embed an <iframe> in an html page |
| Message-ID | <pjv87o$q9s$1@reader1.panix.com> |
I'd like to display postscript files within <iframe>'s on my html pages, pretty much exactly like I'm already doing for pdf files using https://viewerjs.org/ with a tag something like <iframe src="/ViewerJS/#../somefile.pdf" width=400 height=300></iframe> Except I want that to be somefile.ps instead of .pdf I know I could use ImageMagick convert somefile.ps somefile.pdf (or similar), but these postscript files are being generated in real time, and attempts using such converters actually take too long, given our requirements. -- John Forkosh ( mailto: j@f.com where j=john and f=forkosh )
[toc] | [next] | [standalone]
| From | John Reiser <vendor@BitWagon.com> |
|---|---|
| Date | 2018-08-03 16:59 -0700 |
| Message-ID | <qfKdnQE3JunNcfnGnZ2dnUU7_83NnZ2d@giganews.com> |
| In reply to | #3286 |
> I know I could use ImageMagick convert somefile.ps somefile.pdf (or similar), > but these postscript files are being generated in real time, and attempts > using such converters actually take too long, given our requirements. Please be specific why ghostscript does not work. Quantify what is "too long". How many bytes in the .ps input? Say something about the duration of procedures in loops and recursion, versus "straight-line code".
[toc] | [prev] | [next] | [standalone]
| From | John Forkosh <forkosh@panix.com> |
|---|---|
| Date | 2018-08-04 09:08 +0000 |
| Message-ID | <pk3qf3$glr$1@reader1.panix.com> |
| In reply to | #3287 |
John Reiser <vendor@bitwagon.com> wrote: >> I know I could use ImageMagick convert somefile.ps somefile.pdf >> (or similar), but these postscript files are being generated >> in real time, and attempts using such converters actually take >> too long, given our requirements. > Please be specific why ghostscript does not work. > Quantify what is "too long". How many bytes in the .ps input? > Say something about the duration of procedures in loops and > recursion, versus "straight-line code". gs >>does<< work, but that's running on my desktop box. Shared host (dreamhost.com) doesn't have texlive installed (and replied to email that they don't want to), although I could put it under my own account if it comes to that (if no answer to my actual question exists). But that might nevertheless still take too long... ...where "too long" means it takes the page too long to (re-)load, as comfortably viewed by a person. Not a quantitative measure. In any case, thanks for the reply, although it doesn't sound to me like you intend to actually answer the question -- heck, you even cut the actual question out of your followup. So let me ressurect it below, just in case someone else can help... +-------------------+ | Actual Question | +-------------------+ I'd like to display postscript files within <iframe>'s on my html pages, pretty much exactly like I'm already doing for pdf files using https://viewerjs.org/ with a tag something like <iframe src="/ViewerJS/#../somefile.pdf" width=400 height=300></iframe> Except I want that to be somefile.ps instead of .pdf Is there a viewerjs-like package that can do that? Thanks, -- John Forkosh ( mailto: j@f.com where j=john and f=forkosh )
[toc] | [prev] | [next] | [standalone]
| From | luser droog <luser.droog@gmail.com> |
|---|---|
| Date | 2018-08-04 07:10 -0700 |
| Message-ID | <43bfb5cc-97e7-4e99-badd-4e5276c2fb6f@googlegroups.com> |
| In reply to | #3286 |
On Thursday, August 2, 2018 at 10:33:12 AM UTC-5, John Forkosh wrote: > I'd like to display postscript files within <iframe>'s on my html pages, > pretty much exactly like I'm already doing for pdf files using > https://viewerjs.org/ > with a tag something like > <iframe src="/ViewerJS/#../somefile.pdf" width=400 height=300></iframe> > Except I want that to be somefile.ps instead of .pdf > > I know I could use ImageMagick convert somefile.ps somefile.pdf (or similar), > but these postscript files are being generated in real time, and attempts > using such converters actually take too long, given our requirements. From your response to John Reiser, I understand that the ps code is being produced by TeX. TeX generates code that exercises lots of corner cases in the PS standard and you'll really need a robust interpreter to process that code. So it's unlikely that you're going to find an implementation in JavaScript that can do this. If the input were a more limited set of postscript operators, then handling that might be an appropriately sized JavaScript project for a small team in a short time. And you might find a few ps.js projects that already do the job within these kind of constraints. Another possibility exists. I haven't tried this but conceivably ghostscript could be compiled with emscripten to produce an interpreter that runs in the browser. Stitching up all the ins and outs to make it really work is beyond my expertise.
[toc] | [prev] | [next] | [standalone]
| From | John Forkosh <forkosh@panix.com> |
|---|---|
| Date | 2018-08-04 15:17 +0000 |
| Message-ID | <pk4g2r$9nv$1@reader1.panix.com> |
| In reply to | #3289 |
luser droog <luser.droog@gmail.com> wrote: > On Thursday, August 2, 2018 at 10:33:12 AM UTC-5, John Forkosh wrote: >> I'd like to display postscript files within <iframe>'s on my html pages, >> pretty much exactly like I'm already doing for pdf files using >> https://viewerjs.org/ >> with a tag something like >> <iframe src="/ViewerJS/#../somefile.pdf" width=400 height=300></iframe> >> Except I want that to be somefile.ps instead of .pdf >> >> I know I could use ImageMagick convert somefile.ps somefile.pdf >> (or similar), but these postscript files are being generated in >> real time, and attempts using such converters actually take too >> long, given our requirements. > > From your response to John Reiser, I understand that the ps code is > being produced by TeX. Sorry, no. When I said "gs >>does<< work" (if that's what your inference's based on), I meant that ps2pdf works doing the eponymous ps-->pdf conversion. The input ps file itself is generated by a compiled C program running as a cgi on the web. > TeX generates code that exercises lots of corner > cases in the PS standard and you'll really need a robust interpreter > to process that code. So it's unlikely that you're going to find an > implementation in JavaScript that can do this. I don't really care about js, per se, just behavior similar to that of https://viewerjs.org/ What I care about is the html page that I have to write, where <iframe src="path/somefile.ps"></iframe> is trivial to write. So a viewerjs-like tool for ps would be great. I don't care at all (besides curiosity) about its internals; only that it lets me write an <iframe> inside of which a ps file is displayed. > If the input were a more limited set of postscript operators, then > handling that might be an appropriately sized JavaScript project for > a small team in a short time. And you might find a few ps.js projects > that already do the job within these kind of constraints. > > Another possibility exists. I haven't tried this but conceivably > ghostscript could be compiled with emscripten to produce an interpreter > that runs in the browser. Stitching up all the ins and outs to make > it really work is beyond my expertise. Thanks, but no thanks:) Not looking to get involved in yet another project. Just looking for something that already exists. This is a tool as far as I'm concerned, just like a C compiler is a tool, but that doesn't mean I want to get involved writing either one. -- John Forkosh ( mailto: j@f.com where j=john and f=forkosh )
[toc] | [prev] | [next] | [standalone]
| From | Eli the Bearded <*@eli.users.panix.com> |
|---|---|
| Date | 2018-08-04 23:59 +0000 |
| Message-ID | <eli$1808041959@qaz.wtf> |
| In reply to | #3290 |
In comp.lang.postscript, John Forkosh <forkosh@panix.com> wrote: > Sorry, no. When I said "gs >>does<< work" (if that's what your > inference's based on), I meant that ps2pdf works doing the > eponymous ps-->pdf conversion. The input ps file itself is > generated by a compiled C program running as a cgi on the web. Imagemagick's convert can do PS to raster, but it does use ghostscript behind the scenes. That suggests you might be able to use the Imagemagick library in your program and just generate raster on the fly. (Might require including .so files or finding a way to statically link the program.) Elijah ------ and imagemagick is very popular, dreamhost may have it already
[toc] | [prev] | [next] | [standalone]
| From | John Forkosh <forkosh@panix.com> |
|---|---|
| Date | 2018-08-05 08:30 +0000 |
| Message-ID | <pk6cid$qrm$1@reader1.panix.com> |
| In reply to | #3291 |
Eli the Bearded <*@eli.users.panix.com> wrote: > In comp.lang.postscript, John Forkosh <forkosh@panix.com> wrote: >> Sorry, no. When I said "gs >>does<< work" (if that's what your >> inference's based on), I meant that ps2pdf works doing the >> eponymous ps-->pdf conversion. The input ps file itself is >> generated by a compiled C program running as a cgi on the web. > > Imagemagick's convert can do PS to raster, but it does use ghostscript > behind the scenes. That suggests you might be able to use the > Imagemagick library in your program and just generate raster on the fly. > (Might require including .so files or finding a way to statically link > the program.) > Elijah > ------ > and imagemagick is very popular, dreamhost may have it already Yeah, and I've used convert to generate pbm's via popen() in C programs, and read/parse the output to construct actual bitmap rasters of gif (and occasionally ps) images I wanted to further manipulate. And that does work fine, but convert'ing ps isn't what I'm looking for. On the other hand, maybe if I can run gv in an html <iframe>, passing it a filename to view, that might just do the trick. -- John Forkosh ( mailto: j@f.com where j=john and f=forkosh )
[toc] | [prev] | [next] | [standalone]
| From | John Forkosh <forkosh@panix.com> |
|---|---|
| Date | 2018-08-05 07:58 +0000 |
| Message-ID | <pk6anq$1jd$1@reader1.panix.com> |
| In reply to | #3289 |
luser droog <luser.droog@gmail.com> wrote: > On Thursday, August 2, 2018 at 10:33:12 AM UTC-5, John Forkosh wrote: >> I'd like to display postscript files within <iframe>'s on my html pages, >> pretty much exactly like I'm already doing for pdf files using >> https://viewerjs.org/ >> with a tag something like >> <iframe src="/ViewerJS/#../somefile.pdf" width=400 height=300></iframe> >> Except I want that to be somefile.ps instead of .pdf <<snip>> > If the input were a more limited set of postscript operators, then > handling that might be an appropriately sized JavaScript project for > a small team in a short time. And you might find a few ps.js projects > that already do the job within these kind of constraints. In case you're curious about this kind of stuff, the only thing I was able to find is https://github.com/zaphod42/PostscriptJS I took a look at it, but couldn't quite figure out what his Viewer.js code is doing (not too familiar with js), and his ps.html test page that uses it isn't working (for me, when I just tried pointing my browser to an installed copy). I tried messing around with it a bit, but without any success. But if it did plug-and-play "just work" (just like https://viewerjs.org/ works for pdf), then that would be what I'm looking for. <<snip>> -- John Forkosh ( mailto: j@f.com where j=john and f=forkosh )
[toc] | [prev] | [next] | [standalone]
| From | Jean-Francois Moine <moinejf@free.fr> |
|---|---|
| Date | 2018-08-17 18:36 +0200 |
| Message-ID | <20180817183639.e35bde1b098dd134fd12caab@free.fr> |
| In reply to | #3292 |
On Sun, 5 Aug 2018 07:58:50 +0000 (UTC)
John Forkosh <forkosh@panix.com> wrote:
> luser droog <luser.droog@gmail.com> wrote:
> > On Thursday, August 2, 2018 at 10:33:12 AM UTC-5, John Forkosh wrote:
> >> I'd like to display postscript files within <iframe>'s on my html pages,
> >> pretty much exactly like I'm already doing for pdf files using
> >> https://viewerjs.org/
> >> with a tag something like
> >> <iframe src="/ViewerJS/#../somefile.pdf" width=400 height=300></iframe>
> >> Except I want that to be somefile.ps instead of .pdf
> <<snip>>
>
> > If the input were a more limited set of postscript operators, then
> > handling that might be an appropriately sized JavaScript project for
> > a small team in a short time. And you might find a few ps.js projects
> > that already do the job within these kind of constraints.
>
> In case you're curious about this kind of stuff,
> the only thing I was able to find is
> https://github.com/zaphod42/PostscriptJS
[snip]
Some time ago, I found wps.js which works fine enough:
http://logand.com/sw/wps/
I am using it in my project abc2svg (see modules/wps.js in
https://chiselapp.com/user/moinejf/repository/abc2svg).
I just changed the HTML5 output to SVG.
--
Jean-Francois Moine <moinejf@free.fr>
[toc] | [prev] | [next] | [standalone]
| From | John Forkosh <forkosh@panix.com> |
|---|---|
| Date | 2018-08-18 12:51 +0000 |
| Message-ID | <pl94oi$a6q$1@reader1.panix.com> |
| In reply to | #3296 |
Jean-Francois Moine <moinejf@free.fr> wrote: > On Sun, 5 Aug 2018 07:58:50 +0000 (UTC) > John Forkosh <forkosh@panix.com> wrote: >> luser droog <luser.droog@gmail.com> wrote: >> > On Thursday, August 2, 2018 at 10:33:12 AM UTC-5, John Forkosh wrote: >> >> I'd like to display postscript files within <iframe>'s on my html pages, >> >> pretty much exactly like I'm already doing for pdf files using >> >> https://viewerjs.org/ >> >> with a tag something like >> >> <iframe src="/ViewerJS/#../somefile.pdf" width=400 height=300></iframe> >> >> Except I want that to be somefile.ps instead of .pdf >> <<snip>> >> >> > If the input were a more limited set of postscript operators, then >> > handling that might be an appropriately sized JavaScript project for >> > a small team in a short time. And you might find a few ps.js projects >> > that already do the job within these kind of constraints. >> >> In case you're curious about this kind of stuff, >> the only thing I was able to find is >> https://github.com/zaphod42/PostscriptJS > [snip] > > Some time ago, I found wps.js which works fine enough: > http://logand.com/sw/wps/ That kind of looks promising, but I'm not seeing any kind of "download link" for wps anywhere on that page (nor anywhere else I looked on logan.com). For that https://viewerjs.org/ stuff, you just download ViewerJS-latest.zip and unzip it in the root directory of your site, automatically creating a ViewerJS/ subdirectory with all the software you need. Then a simple tag like <iframe src="/ViewerJS/#../somefile.pdf" width=400 height=300></iframe> "magically" displays the pdf file. Took me all of five minutes to get it working out-of-the-box (and I didn't even have to look inside the box, just unzip it). > I am using it in my project abc2svg (see modules/wps.js in > https://chiselapp.com/user/moinejf/repository/abc2svg). > I just changed the HTML5 output to SVG. Yeah, I certainly would "see modules/wps.js" to see how you're using wps, which I couldn't figure out from that .../sw/wps/ page, except I'm not seeing wps anywhere on your abc2svg page at all. -- John Forkosh ( mailto: j@f.com where j=john and f=forkosh )
[toc] | [prev] | [next] | [standalone]
| From | Jean-Francois Moine <moinejf@free.fr> |
|---|---|
| Date | 2018-08-18 20:22 +0200 |
| Message-ID | <20180818202215.0ec380c4f935b036aa7dd570@free.fr> |
| In reply to | #3297 |
On Sat, 18 Aug 2018 12:51:30 +0000 (UTC) John Forkosh <forkosh@panix.com> wrote: > > Some time ago, I found wps.js which works fine enough: > > http://logand.com/sw/wps/ > > That kind of looks promising, but I'm not seeing any kind > of "download link" for wps anywhere on that page (nor anywhere > else I looked on logan.com). > For that https://viewerjs.org/ stuff, you just download > ViewerJS-latest.zip and unzip it in the root directory of > your site, automatically creating a ViewerJS/ subdirectory > with all the software you need. Then a simple tag like > <iframe src="/ViewerJS/#../somefile.pdf" width=400 height=300></iframe> > "magically" displays the pdf file. Took me all of five minutes > to get it working out-of-the-box (and I didn't even have to look > inside the box, just unzip it). Indeed, wps asks for some code to make it work as you want. This should not be difficult for a javascript programmer. (I could do it, but I have no use for that, sorry). > > I am using it in my project abc2svg (see modules/wps.js in > > https://chiselapp.com/user/moinejf/repository/abc2svg). > > I just changed the HTML5 output to SVG. > > Yeah, I certainly would "see modules/wps.js" to see how you're > using wps, which I couldn't figure out from that .../sw/wps/ page, > except I'm not seeing wps anywhere on your abc2svg page at all. Well, this is a fossil repository. Click on 'files', and then on 'modules'. But the wps source is of no interest for you: it just contains some bug fixes. -- Jean-Francois Moine <moinejf@free.fr>
[toc] | [prev] | [next] | [standalone]
| From | John Forkosh <forkosh@panix.com> |
|---|---|
| Date | 2018-08-21 09:07 +0000 |
| Message-ID | <plgknk$b3g$1@reader1.panix.com> |
| In reply to | #3298 |
Jean-Francois Moine <moinejf@free.fr> wrote: > On Sat, 18 Aug 2018 12:51:30 +0000 (UTC) > John Forkosh <forkosh@panix.com> wrote: > >> > Some time ago, I found wps.js which works fine enough: >> > http://logand.com/sw/wps/ >> >> That kind of looks promising, but I'm not seeing any kind >> of "download link" for wps anywhere on that page (nor anywhere >> else I looked on logan.com). >> For that https://viewerjs.org/ stuff, you just download >> ViewerJS-latest.zip and unzip it in the root directory of >> your site, automatically creating a ViewerJS/ subdirectory >> with all the software you need. Then a simple tag like >> <iframe src="/ViewerJS/#../somefile.pdf" width=400 height=300></iframe> >> "magically" displays the pdf file. Took me all of five minutes >> to get it working out-of-the-box (and I didn't even have to look >> inside the box, just unzip it). > > Indeed, wps asks for some code to make it work as you want. > This should not be difficult for a javascript programmer. > (I could do it, but I have no use for that, sorry). Thanks for the additional info. I'll take a more detailed look at it, but probably more work than I want to invest for the purpose at hand. After finding viewerjs.org for pdf, I was just hoping a similar out-of-the-box solution existed for ps. Apparently not. >> > I am using it in my project abc2svg (see modules/wps.js in >> > https://chiselapp.com/user/moinejf/repository/abc2svg). >> > I just changed the HTML5 output to SVG. >> >> Yeah, I certainly would "see modules/wps.js" to see how you're >> using wps, which I couldn't figure out from that .../sw/wps/ page, >> except I'm not seeing wps anywhere on your abc2svg page at all. > > Well, this is a fossil repository. Click on 'files', and then on > 'modules'. But the wps source is of no interest for you: it just > contains some bug fixes. Right. Don't know how I missed that. Thanks, again. -- John Forkosh ( mailto: j@f.com where j=john and f=forkosh )
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.postscript
csiph-web