Python-错误的阅读器

时间:2019-11-08 23:13:28

标签: python kivy python-3.6 pdfminer

我正在为Android开发电子图书馆。所有书籍均以pdf格式存储。当您单击该按钮时,pdf阅读器应打开,但无法正常工作:文本会叠加在其自身上

我试图更改阅读器窗口的大小font_size,但是由于某些原因,阅读器的参数没有改变

def class MainScreen(Screen):
    def russ_yaz(self):
        fn = 'Дудников, А.В Русский язык.pdf'
        root = PDFDocumentWidget(source=fn, cols=1)
        runTouchApp(root)
        PDFDocumentWidget()

    def russ_lit(self):
        fn = 'Дудников, А.В Русская литература.pdf'
        root = PDFDocumentWidget(source=fn, cols=1)
        runTouchApp(root)
        PDFDocumentWidget()
<PDFDocumentWidget>:
    viewclass: 'PDFPageWidget'
    key_size: 'size'
    # async load is buggy at the moment
    # async_load: True

    RecycleGridLayout:
        spacing: 10
        cols: root.cols
        rows: root.rows
        size_hint: None, None
        size: self.minimum_size
        default_size_hint: None, None
<PDFPageWidget>:
    size_hint: None, None

    canvas.before:
        Color:
            rgba: RGBA('FFFFFF')
        Rectangle:
            size: self.size
<PDFLabelWidget,PDFImageWidget>:
    size_hint: None, None
<PDFImageWidget>:
    pos: self.bbox[:2]
    size: self.bbox[2] - self.x, self.bbox[3] - self.y
<PDFLabelWidget>:
    text_size: self.width, None
    height: self.texture_size[1]
    color: RGBA('000000')
    font_size: 4
<Button1@Button>:
    background_color:255, 255, 255, 1
    size:300,150
    size_hint:None, None
<Image>:
    source:'фон.jpg'
    allow_stretch: True  
<Label>:
    color:0,0,0,1
    font_size:30
<BoxLayout>:
    orientation:'vertical'  
    spacing:200
    padding:170,200
    background_color:1,1,1,1
<MainScreen>:
    name:"Menu"
    Image
    BoxLayout:
        Button1:
            text:"Русская литература"
            on_press: root.russ_lit()
        Button1:
            text:"Русский язык"
            on_press: root.russ_yaz()
from os.path import exists
from tempfile import mkdtemp, mkstemp
from shutil import rmtree
from binascii import b2a_hex
from os import write, close
from threading import Thread
from kivy.app import App
from kivy.lang import Builder
from kivy.uix.recycleview import RecycleView
from kivy.uix.screenmanager import ScreenManager, Screen
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.gridlayout import GridLayout
from kivy.config import Config
from kivy.config import Config
from kivy.graphics.vertex_instructions import Line
from pdfminer.pdfpage import PDFPage
from pdfminer.pdfparser import PDFParser
from pdfminer.converter import PDFPageAggregator
from pdfminer.pdfdocument import PDFDocument, PDFNoOutlines
from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter
from pdfminer.layout import (
    LAParams, LTTextBox, LTTextLine, LTFigure, LTImage, LTChar, LTCurve,
    LTLine, LTRect,)
from kivy.lang import Builder
from kivy.clock import Clock
import kivy.graphics
from kivy.graphics import Mesh, Color
from kivy.graphics.tesselator import Tesselator
from kivy.uix.widget import Widget
from kivy.uix.recycleview import RecycleView
from kivy.uix.label import Label
from kivy.uix.image import Image
from kivy.uix.relativelayout import RelativeLayout
from kivy.uix.boxlayout import BoxLayout
from kivy.properties import (
    StringProperty, ListProperty, NumericProperty, AliasProperty,
    DictProperty, ObjectProperty, BooleanProperty, ColorProperty,
)

我希望读者能正确打开书本

0 个答案:

没有答案