pdf-rendering

PdfRendering zoom on page

三世轮回 提交于 2021-02-19 04:17:55
问题 I'm working on a project where I need to display PDF content inside our application. I'm trying to use PdfRenderer of Android API. For now, I'm able to show a pdf page as bitmap and move between all other pages. But I don't understand how to implement zoom on a page. I mean I know how to zoom an image, but for pdf it needs to be recalculated at every zoom level (such as tile ?). On zoom I need to recalculate Bitmap with correct Rect and Matrix I guess, that's the point I'm missing. Does some

Android v23 PDFreader keep crashing

廉价感情. 提交于 2019-12-25 04:33:18
问题 I am new here however wondering if someone could point me in the right direction. This is part of my app in which I want to read PDF file from assets and display in the fragment. Android version used 23.4.0 public class PDFFragment extends Fragment { private ParcelFileDescriptor fileDescriptor; private PdfRenderer pdfRenderer; private PdfRenderer.Page currentPage; private ImageView image; private Button buttonPrevious; private Button buttonNext; public PDFFragment() { // Required empty public

CGContextDrawPDFPage memory Leak - App Crash

狂风中的少年 提交于 2019-12-18 07:52:12
问题 When I analyze my app with Instruments, I found out that data allocated by CGContextDrawPDFPage is not released immediately. App getting crash because of CGContextDrawPDFPage . Hello here is my code for drawing pdf in CATiledlayer - (void)drawLayer:(CATiledLayer *)layer inContext:(CGContextRef)context { if (_PDFPageRef == nil) { return; } CGPDFPageRef drawPDFPageRef = NULL; CGPDFDocumentRef drawPDFDocRef = NULL; @synchronized(self) // Briefly block main thread { drawPDFDocRef =

Displaying PDF files with python3

老子叫甜甜 提交于 2019-12-03 09:34:52
问题 I want to write a python3/PyGTK3 application that displays PDF files and I was not able to find a python package that allows me to do that. There is pypoppler, but it looks outdated (?) and does not seem to support python3 (?) Do you have any suggestions? EDIT: Note, that I don't need fancy features, like pdf forms, manipulation or writing. 回答1: It turns out, that newer versions of poppler-glib don't require bindings as such. They ship with GObject Introspection files and can therefore be

How to render whole pdf document using pdf.js library?

纵饮孤独 提交于 2019-11-30 12:54:15
问题 I tried rendering PDF document using pdf.js library. I know only basics in javascript and I am new to promises, so at first I followed advice on this page: Render .pdf to single Canvas using pdf.js and ImageData (2. answer). But as a result, I rendered my document with all pages blank. All pictures and colors are fine, but not even a line of text. I also tried some other tutorials, but either I get the same result, or the document is completely missing. Right now, my code looks like this: (It

How to render whole pdf document using pdf.js library?

孤人 提交于 2019-11-30 04:02:50
I tried rendering PDF document using pdf.js library. I know only basics in javascript and I am new to promises, so at first I followed advice on this page: Render .pdf to single Canvas using pdf.js and ImageData (2. answer). But as a result, I rendered my document with all pages blank. All pictures and colors are fine, but not even a line of text. I also tried some other tutorials, but either I get the same result, or the document is completely missing. Right now, my code looks like this: (It's almost identical to the tutorial) function loadPDFJS(pid, pageUrl){ PDFJS.disableWorker = true;