mirror of
				https://github.com/kovidgoyal/calibre.git
				synced 2025-11-04 03:27:00 -05:00 
			
		
		
		
	...
This commit is contained in:
		
							parent
							
								
									250e2a4a06
								
							
						
					
					
						commit
						8a55b0dc79
					
				@ -32,10 +32,11 @@ class PDFInput(InputFormatPlugin):
 | 
			
		||||
 | 
			
		||||
    def convert_new(self, stream, accelerators):
 | 
			
		||||
        from calibre.ebooks.pdf.reflow import PDFDocument
 | 
			
		||||
        from calibre.utils.cleantext import clean_ascii_chars
 | 
			
		||||
        if pdfreflow_err:
 | 
			
		||||
            raise RuntimeError('Failed to load pdfreflow: ' + pdfreflow_err)
 | 
			
		||||
        pdfreflow.reflow(stream.read(), 1, -1)
 | 
			
		||||
        xml = open('index.xml', 'rb').read()
 | 
			
		||||
        xml = clean_ascii_chars(open('index.xml', 'rb').read())
 | 
			
		||||
        PDFDocument(xml, self.opts, self.log)
 | 
			
		||||
        return os.path.join(os.getcwd(), 'metadata.opf')
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user