swftools-common
[Top][All Lists]
Advanced

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

[Swftools-common] Trouble when gfx rendering a protected PDF file. Appli


From: Joel Shapiro
Subject: [Swftools-common] Trouble when gfx rendering a protected PDF file. Application exits.
Date: Tue, 20 Jul 2010 11:21:44 -0700 (PDT)

Trouble when gfx rendering a protected PDF file.  Application exits.
 

Hello All,


The following snippet from my Python app works perfectly - until a protected

.PDF file is encountered - The application exits and I can't seem to find an exception

that covers it.  Also is the snippet from the Idle Shell :


       try:
         doc = gfx.open("pdf", ComnPDF)

         text = gfx.PlainText()
     
        # gfx.setparameter("zoom", "400")
        # text = gfx.OCR()

         for pagenr in range(1,doc.pages+1):
          page = doc.getPage(pagenr)
          text.startpage(page.width, page.height)
          page.render(text)
          text.endpage()
         text.save("G:/MovableIdle-Python-2.5/document_fulltext.txt")
         f = open("G:/MovableIdle-Python-2.5/document_fulltext.txt", 'r')

         CurrentText = f.read()

         f.close()
         LengthBytes = len(CurrentText)

        except socket.timeout:
         print "PDF Socket timeout error"
        except ValueError:
         print "PDF Value error"
        except TypeError:
         print "PDF TypeError error"
        except Exception:
         print "gfx open exception"
        except IOError:
         print "PDF IO error"
        except SystemExit:
         print "system Exit exception"
        except:
         print "PDF unexpected error:", sys.exc_info()[0]
         raise
 


Here's from my Python IDLE:



Current URL: http://cultureblog.homeword.com/weblog/2010/06/early-school-start-times-raise-risk-of-teen-car-crashes.html

Length Current URL: 39087 bytes

{'confidence': 1.0, 'encoding': 'ascii'}

ISO-8559-X still under construction

Number matches latin-1 count: later:  2 later ENGLISH: en
Number matches latin-1 count: school:  31 school ENGLISH: en
Number matches latin-1 count: start:  22 start ENGLISH: en
Number matches latin-1 count: time:  26 time ENGLISH: en
Number matches latin-1 count: increased:  3 increased ENGLISH: en
Number matches latin-1 count: health:  11 health ENGLISH: en
Number matches latin-1 count: alert:  7 alert ENGLISH: en
Number matches latin-1 count: sleep:  14 sleep ENGLISH: en
Number matches latin-1 count: accident:  3 accident ENGLISH: en
Number matches latin-1 count: rate:  8 rate ENGLISH: en
Number matches latin-1 count: better:  4 better ENGLISH: en
Number matches latin-1 count: grades:  4 grades ENGLISH: en
Number matches latin-1 count: reference:  1 reference ENGLISH: en
Number matches latin-1 count: rates:  4 rates ENGLISH: en
Number matches latin-1 count: adolescent:  3 adolescent ENGLISH: en



Current run time: 883 seconds

Start scan key press to halt processing for: 1 seconds
End scan key press to halt processing.

Current URL: http://www.wayland.k12.ma.us/district/district_info/departments/superintendent/reports/schoolstarttimes.pdf

>>> ================================ RESTART ================================
>>>


Thanks,

Joel S.


reply via email to

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