CorePDF | A basic PDF library that works with .net core | Document Editor library
kandi X-RAY | CorePDF Summary
kandi X-RAY | CorePDF Summary
A basic PDF library that works with .net core that you can do with as you please.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of CorePDF
CorePDF Key Features
CorePDF Examples and Code Snippets
Community Discussions
Trending Discussions on CorePDF
QUESTION
I have what I thought was a simple View Controller to displayed a preloaded PDF file. The path to the PDF is passed into var pdfPath by the pervious controller.
I have an action/share button I'm trying to use for sharing and printing the PDF using PDFDocument.dataRepresentation(). According to multiple sources online, it should work, but I'm getting a strange error:
[Unknown process name] Failed to load /System/Library/PrivateFrameworks/CorePDF.framework/Versions/A/CorePDF
Code:
...ANSWER
Answered 2020-Jul-12 at 00:12Rather than passing the data, you can pass the URL of the file, which UIActivityViewController
will recognise and display share options accordingly.
QUESTION
import UIKit
import PDFKit
class ViewController: UIViewController {
@IBOutlet weak var pdfView: PDFView!
lazy var pdfDoc:PDFDocument? = {
guard let path = Bundle.main.path(forResource: "6368", ofType: "pdf") else {return nil}
let url = URL(fileURLWithPath: path)
return PDFDocument(url: url)
}()
override func viewDidLoad() {
super.viewDidLoad()
self.setupPDFView()
self.save()
}
func setupPDFView() {
//Setup and put pdf on view
pdfView.autoScales = true
pdfView.displayMode = .singlePageContinuous
pdfView.displayDirection = .horizontal
pdfView.document = pdfDoc
self.add(annotation: self.circleAnnotation(), to: 0)
}
func add(annotation: PDFAnnotation, to page:Int){
self.pdfDoc?.page(at: page)?.addAnnotation(annotation)
}
func circleAnnotation()->PDFAnnotation {
let bounds = CGRect(x: 20.0, y: 20.0, width:200.0, height: 200.0)
let annotation = PDFAnnotation(bounds: bounds, forType: .circle, withProperties: nil)
annotation.interiorColor = UIColor.black
return annotation
}
func save() {
//Save to file
guard let url = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first else {return}
let data = pdfView.document?.dataRepresentation()
do {
if data != nil{try data!.write(to: url)}
}
catch {
print(error.localizedDescription)
}
}
}
...ANSWER
Answered 2018-Dec-18 at 13:56You can call like this:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install CorePDF
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page