all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Viewing PDF/PS files
@ 2007-05-16  3:29 mowgli
  2007-05-16 14:30 ` weber
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: mowgli @ 2007-05-16  3:29 UTC (permalink / raw)
  To: help-gnu-emacs

Is it possible to view PDF or PS files in the emacs on console? If
yes, how?

Regards,
mowgli

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Viewing PDF/PS files
  2007-05-16  3:29 Viewing PDF/PS files mowgli
@ 2007-05-16 14:30 ` weber
  2007-05-16 17:28   ` mowgli
  2007-05-17  4:35 ` William Xu
  2007-05-17  9:38 ` James Cloos
  2 siblings, 1 reply; 6+ messages in thread
From: weber @ 2007-05-16 14:30 UTC (permalink / raw)
  To: help-gnu-emacs

On 16 maio, 00:29, mowgli <knowledgel...@gmail.com> wrote:
> Is it possible to view PDF or PS files in the emacs on console? If
> yes, how?
>
> Regards,
> mowgli

You mean like extracting text from those files ?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Viewing PDF/PS files
  2007-05-16 14:30 ` weber
@ 2007-05-16 17:28   ` mowgli
  2007-05-17  9:07     ` Tim X
  0 siblings, 1 reply; 6+ messages in thread
From: mowgli @ 2007-05-16 17:28 UTC (permalink / raw)
  To: help-gnu-emacs

On May 16, 7:30 pm, weber <hug...@gmail.com> wrote:
> On 16 maio, 00:29, mowgli <knowledgel...@gmail.com> wrote:
>
> > Is it possible to view PDF or PS files in the emacs on console? If
> > yes, how?
>
> > Regards,
> > mowgli
>

> You mean like extracting text from those files ?

No, not extracting but actually being able to read ps files directly
in to emacs. I think emacs can convert to ps files, then can't it read
them? On the console version, not in X I mean.

Regards,
mowgli

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Viewing PDF/PS files
  2007-05-16  3:29 Viewing PDF/PS files mowgli
  2007-05-16 14:30 ` weber
@ 2007-05-17  4:35 ` William Xu
  2007-05-17  9:38 ` James Cloos
  2 siblings, 0 replies; 6+ messages in thread
From: William Xu @ 2007-05-17  4:35 UTC (permalink / raw)
  To: help-gnu-emacs

mowgli <knowledgeless@gmail.com> writes:

   Is it possible to view PDF or PS files in the emacs on console? If
   yes, how?

Possibly not. But i remember there are tools that are capable of viewing
DVI files on console.


        William

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Viewing PDF/PS files
  2007-05-16 17:28   ` mowgli
@ 2007-05-17  9:07     ` Tim X
  0 siblings, 0 replies; 6+ messages in thread
From: Tim X @ 2007-05-17  9:07 UTC (permalink / raw)
  To: help-gnu-emacs

mowgli <knowledgeless@gmail.com> writes:

> On May 16, 7:30 pm, weber <hug...@gmail.com> wrote:
>> On 16 maio, 00:29, mowgli <knowledgel...@gmail.com> wrote:
>>
>> > Is it possible to view PDF or PS files in the emacs on console? If
>> > yes, how?
>>
>> > Regards,
>> > mowgli
>>
>
>> You mean like extracting text from those files ?
>
> No, not extracting but actually being able to read ps files directly
> in to emacs. I think emacs can convert to ps files, then can't it read
> them? On the console version, not in X I mean.
>

No it can't do that. Generating a PS file is very different from displaying
one. To do this, you would need a point/pixel level drawing routine and the
ability to print a pixel at any location etc, plus the ability to interpret the
font specifications in the PS etc. 

The best you can do is

1. convert to text. I have a utility that pretty much automates this process.
If you try to view a PS, PDF or DOC file, it uses external conversion utilities
to convert the document to a plain text format and display that in a buffer.

2. Use one of the 'runit' type emacs extensions that are out there. These
extensions will pass the file to an external program like ghostview or xpdf to
display the document. 

Tim


-- 
tcross (at) rapttech dot com dot au

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Viewing PDF/PS files
  2007-05-16  3:29 Viewing PDF/PS files mowgli
  2007-05-16 14:30 ` weber
  2007-05-17  4:35 ` William Xu
@ 2007-05-17  9:38 ` James Cloos
  2 siblings, 0 replies; 6+ messages in thread
From: James Cloos @ 2007-05-17  9:38 UTC (permalink / raw)
  To: mowgli; +Cc: help-gnu-emacs

>>>>> "mowgli" == mowgli  <knowledgeless@gmail.com> writes:

mowgli> Is it possible to view PDF or PS files in the emacs on console?
mowgli> If yes, how?

That depends on which console, which version of emacs and compile time
options at the very least.

If you on at the linux console, and it is a frame buffer rather than a
vga text console, it may be possible.  I can't speak for other kernels'
consoles.  And I haven't tried it even on a frame buffer console, so
this is unconfirmed advice.

And none of this is written, as far as I know.  You'll have to write
some code to make it work.

What you would need to do is to arrange for emacs to pass the postscript
in question to ghostscript with appropriate options to render the ps to
graphic files at some reasonable dpi, and then open those image files in
an emacs buffer in image mode to display them.

The dpi should be approximently framebuffer_width_in_pixels divided by
paper_width_in_inches.  So, if you have a 1600x1200 pixel display and
the postscript document is intended for US-Letter sized paper, that is
1600/8.5 or about 188 dpi.

That is, if you want the rendered images to be maximum width.  The math
for fitting the whole page on a single screen should be obvious.  If the
PS's papersize is not Letter (such as an EPS image) you'd need to parse
the PS to find the size and use that to determine the dpi value to pass
to GhostScript to get an image at the correct scale.

I'd probably use gs's png256 output device, if your emacs is compiled
with libpng support.

Incidently, there may be a PS viewer out there (probably written on top
of directfb or svgalib) which you could use instead of writing one in
elisp.  If you don't want to exit emacs to call such a viewer, run
M-x shell to start a shell session w/in emacs and call the viewer from
that shell prompt.

-JimC
-- 
James Cloos <cloos@jhcloos.com>         OpenPGP: 1024D/ED7DAEA6

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-05-17  9:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-16  3:29 Viewing PDF/PS files mowgli
2007-05-16 14:30 ` weber
2007-05-16 17:28   ` mowgli
2007-05-17  9:07     ` Tim X
2007-05-17  4:35 ` William Xu
2007-05-17  9:38 ` James Cloos

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.