gnumed-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnumed-devel] write document failure on windows


From: Karsten Hilbert
Subject: Re: [Gnumed-devel] write document failure on windows
Date: Fri, 13 May 2011 22:37:28 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

On Fri, May 13, 2011 at 06:59:00AM -0700, LuisCapriles wrote:

> I was having the same problem:  while trying to print, the gm-print_doc.bat
> was missing...  So after researching the forum I came with this temporary
> fix:
> 
> 1)Make a gm-print_doc.bat that is in the your PATH.  In my case, I put the
> file in C:\
> 2)The commans in the file are:
> 
> echo %1
> "C:\Archivos de programa\Adobe\Reader 8.0\Reader\AcroRd32.exe" /T %2
> exit 0

Indeed, this should work.

> 3)Here, 'Archivos de programa' is the spanish for 'Program files'.  Take
> care of supply the actual path to AcroRd32.exe.

Does this mean that AcroRd32.exe is not in the PATH ? If
(not) so I'll have to adjust the below printing method:

>  The /T switch prints the
> file on the default printer and then closes Acrobat...

This is what GNUmed-post-0.9 will do when trying to print
via Acrobat Reader. Note that we don't print straight to the
default printer but rather branch into the
select-printer-and-print dialog.

def _print_file_by_acroread_exe(filename):
        """Use Adobe Acrobat Reader. Windows only.

        - docs: http://www.robvanderwoude.com/printfiles.php#PrintPDF
        """
        if os.name != 'nt':
                _log.debug('Acrobat Reader only used under Windows')
                return False

        cmd_line = [
                r'AcroRd32.exe',                        # "AcroRd32.exe" must 
be in the PATH
                r'/s',                                          # no splash
                r'/o',                                          # no open-file 
dialog
                r'/h',                                          # minimized
                r'/p',                                          # go straight 
to printing dialog
                os.path.normpath(filename)
        ]
        _log.debug('printing with %s' % cmd_line)
        try:
                acroread = subprocess.Popen(cmd_line, stdout = subprocess.PIPE, 
stderr = subprocess.PIPE)
        except OSError:
                _log.debug('cannot run <AcroRd32.exe>')
                cmd_line[0] = r'acroread.exe'
                _log.debug('printing with %s' % cmd_line)
                try:
                        acroread = subprocess.Popen(cmd_line, stdout = 
subprocess.PIPE, stderr = subprocess.PIPE)
                except OSError:
                        _log.debug('cannot run <acroread.exe>')
                        return False

        stdout, stderr = acroread.communicate()
        if acroread.returncode != 0:
                _log.error('Acrobat Reader returned [%s], failed to print', 
acroread.returncode)
                return False

        return True

> 4)You need Acrobat Reader installed!!!

I would have thought that one installed it is in the PATH, too ?

> 5)You need some TeX sw!!!  I installed MiKTeX after a suggestion of Karsten
> Hilbert :)
> 
> This is working for me for menu Correspondence->Write Letter and selecting
> LaTeX type...

:-)

> BUT, I am getting letters in german!!!!  Is there a way to get the
> translation??

It depends on what part of the letter you are talking about :-)

1) the LaTeX can contain hardcoded words in German (if its a german template ;-)

2) words hardcoded in German in GNUmed or even in the database
   may be in German if the client and/or database are set to
   German locale

3) if the doctor entered German progress notes (say, in the public
   database) then the printout will contain those progress notes
   in German, of course

I would guess you are suffering most from 1). This means
you'd need to choose an English template. You can, of
course, also create your own templates. To make that easier
one can now export the templates delivered with GNUmed so
that those can be modified and used as your own templates.

> Now, I am going to try OpenOffice type...

Last I worked on OpenOffice support there were some hurdles
not easily overcome without spending a significant amount of
time or not to be overcome at all (greedy regular
expressions). I hope and assume that this will improve when
LibreOffice starts getting better and better. Thus, OOo
support currently is not that great. However, I've seen it
work just yesterday :-)

Karsten
-- 
GPG key ID E4071346 @ gpg-keyserver.de
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346



reply via email to

[Prev in Thread] Current Thread [Next in Thread]