pdfview

pdfView pinch zooming out

走远了吗. 提交于 2019-12-10 04:06:17
问题 I am trying to move my project that was using a webview to display some pdf to a pdfView to take advantage of the latest PDFKit features. in the webview when pinching to zoom out the document was always scaling to fill the screen. basically you could not zoom out the page it was bouncing back to fill the screen. Now with a pdfView, I can zoom out by pinching and it does not look good at all there is no need to have the pdf page to be smaller than the screen... Is there any way to activate the

Disable zooming on PDFView (iOS)

跟風遠走 提交于 2019-12-07 07:23:46
问题 How can I disable zooming on PDFView? I've already tried the solution here, but it didn't work. I can still zoom in and zoom out. Here's my PDFView: let pdfView: PDFView = { let pdfView = PDFVIew() let urlPath = Bundle.main.path(forResource: "PdfFile", ofType: "pdf") let url = URL(fileURLWithPath: urlPath!) pdfView.document = PDFDocument(url: url) pdfView.autoScales = true pdfView.displayMode = .singlePageContinuous pdfView.displayDirection = .vertical pdfView.pageShadowsEnabled = false

How to disable zoom in and zoom out in pdfView?

蹲街弑〆低调 提交于 2019-12-06 11:38:09
I want to have just what I receive after pdfView.autoScales = true without the possibility to change the scale. After the help of @carmine we have: import UIKit import PDFKit class ViewController: UIViewController { @IBOutlet weak var pdfView: PDFView! override func viewDidLoad() { super.viewDidLoad() setPdfFile() } override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) { super.viewWillTransition(to: size, with: coordinator) self.pdfView.autoScales = true } func setPdfFile() { if let path = Bundle.main.path(forResource: "Swift.org - Getting

Disable zooming on PDFView (iOS)

本小妞迷上赌 提交于 2019-12-05 12:35:20
How can I disable zooming on PDFView? I've already tried the solution here , but it didn't work. I can still zoom in and zoom out. Here's my PDFView: let pdfView: PDFView = { let pdfView = PDFVIew() let urlPath = Bundle.main.path(forResource: "PdfFile", ofType: "pdf") let url = URL(fileURLWithPath: urlPath!) pdfView.document = PDFDocument(url: url) pdfView.autoScales = true pdfView.displayMode = .singlePageContinuous pdfView.displayDirection = .vertical pdfView.pageShadowsEnabled = false return pdfView }() Add following line of code will disable zoom of PDFView . override func viewDidAppear(_

Crash with PDFKit on iOS 12.2

你离开我真会死。 提交于 2019-12-02 02:29:13
问题 In iOS 12.2, passing true to PDFView 's usePageViewController(_, withViewOptions:) will cause a crash with the following exception: *** Terminating app due to uncaught exception 'CALayerInvalidGeometry', reason: 'CALayer position contains NaN: [nan nan]' The same code works fine on iOS 12.1. I also have other projects that do this and those projects do work on iOS 12.2, but their view controller hierarchy is quite a bit more complicated. Is there possibly something I'm missing, or should I

Crash with PDFKit on iOS 12.2

旧巷老猫 提交于 2019-12-01 23:51:05
In iOS 12.2, passing true to PDFView 's usePageViewController(_, withViewOptions:) will cause a crash with the following exception: *** Terminating app due to uncaught exception 'CALayerInvalidGeometry', reason: 'CALayer position contains NaN: [nan nan]' The same code works fine on iOS 12.1. I also have other projects that do this and those projects do work on iOS 12.2, but their view controller hierarchy is quite a bit more complicated. Is there possibly something I'm missing, or should I file a bug report with Apple? I have created a tiny project on github which demonstrates the crash at

Cocoa osx PDFView NSPrintOperation PrintPanel not showing page preview

你离开我真会死。 提交于 2019-12-01 21:31:44
In my app for Mac I have a webview that shows some html content. I create a PDFDocument from that webview and then I want to print that document. So I create a PDFView from the document and then I call the NSPrintOperation printOperationWithView. When showing the print panel all appears correct except the page preview which appears blank, but if I press the details button the panel is refreshed and the page preview appears correctly. How can I solve this?? Need help please. Thanks in advance. This is an example of my problem: 1- The print panel shows with a blank page preview. Next I press

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;

Viewing PDF in Windows forms using C# [closed]

给你一囗甜甜゛ 提交于 2019-11-26 22:22:48
Is there any way to view PDF files in a Winforms tool? I've seen solutions such as converting the pdf file into images and showing them in an picture box. However, I am asking whether i can view the file as PDF. Is there any tool from adobe or from Microsoft that supports this? you can use System.Diagnostics.Process.Start as well as WIN32 ShellExecute function by means of interop, for opening PDF files using the default viewer: System.Diagnostics.Process.Start("SOMEAPP.EXE","Path/SomeFile.Ext"); [System.Runtime.InteropServices.DllImport("shell32. dll")] private static extern long ShellExecute