pdfkit

Trigger In-App-Browser after tapping on Annotation with PDFKit - iOS 11

谁都会走 提交于 2019-12-24 09:33:32
问题 I´m working on an app with Apple's PDFKit and have managed to put some Annotation-Buttons with a working PDFActionURL , which open the iOS standard browser after tapping on them. Unfortunately, I did not find a working solution, how to open the associated links in an In-App-Browser or to load it in a webview. After tapping the AnnotationButton PDFKit automatically opens Safari and I haven´t found a property or another way concerning iOS to influence this behavior by manipulating f.e. the

Create PDF of a https webpage which requires login using pdfkit

*爱你&永不变心* 提交于 2019-12-24 07:57:58
问题 I am trying to generate a PDF of a webpage from a https website (Salesforce). I have so far tried using simple_salesforce, which returns a sessionID (cookie) to no avail. from simple_salesforce import Salesforce import pdfkit sf = Salesforce(username='my username' ,password='my password' ,security_token= 'my API security token') path_wkthmltopdf = r'C:\Program Files\wkhtmltopdf\bin\wkhtmltopdf.exe' config = pdfkit.configuration(wkhtmltopdf=bytes(path_wkthmltopdf, 'utf8')) options1 = { 'page

Create PDF of a https webpage which requires login using pdfkit

末鹿安然 提交于 2019-12-24 07:57:05
问题 I am trying to generate a PDF of a webpage from a https website (Salesforce). I have so far tried using simple_salesforce, which returns a sessionID (cookie) to no avail. from simple_salesforce import Salesforce import pdfkit sf = Salesforce(username='my username' ,password='my password' ,security_token= 'my API security token') path_wkthmltopdf = r'C:\Program Files\wkhtmltopdf\bin\wkhtmltopdf.exe' config = pdfkit.configuration(wkhtmltopdf=bytes(path_wkthmltopdf, 'utf8')) options1 = { 'page

how to convert pdfkit object into buffer using nodejs

蓝咒 提交于 2019-12-23 09:58:15
问题 I am generating pdf document using pdfkit(nodejs module).i need to convert the pdfkit object to buffer and send response as attachment file without save a file in server. i was using output function to achieve this: pdfdocument.output(function(buffer){ return buffer; }); pdfkit deprecated the output function. so right now i dont know how to do any idea... 回答1: Working example for pdfkit v0.8.0: let pdf = new pdfkit(); let buffers = []; pdf.on('data', buffers.push.bind(buffers)); pdf.on('end',

PDFKit - PDFView using pageViewController - page rendering slow when swiping to next page

余生长醉 提交于 2019-12-22 04:14:13
问题 I have a PDFView that's set to use a pageViewController: let pdfView = PDFView() let pdfDoc = PDFDocument(url: Bundle.main.url(forResource: "test", withExtension: "pdf")!) pdfView.document = pdfDoc pdfView.autoScales = true pdfView.displayDirection = .horizontal pdfView.usePageViewController(true, withViewOptions: [:]) Whenever I swipe to get to the next page, said next page is blurry for half a second before it's rendered sharply. That is quite annoying. Can I somehow preload the pages? I

Highcharts charts on a page not rendering correctly when output to PDF using wkhtmltopdf

霸气de小男生 提交于 2019-12-22 00:11:52
问题 My wkhtmltopdf PDF output of a page with several Highcharts charts on it is missing some elements of the charts, primarily all of the simple straight lines, including tick marks, grid lines, column borders, legend borders and the lines in my line/spline charts (data points display). I have tried the tricks used to solve this issue from other stack questions, namely setting all of the following on the series: enableMouseTracking: false, shadow: false, animation: false ...as well as setting

PDFKIT apparently not working because of “wkhtmltopdf”

一笑奈何 提交于 2019-12-21 17:06:42
问题 I'm having trouble generating a PDF out of a html page. I'm using PDFkit. In the process of installing it, I noticed I needed wkhtmltopdf. So I installed it too. I did everything PDFkit's documentation said to do.. and now I'm getting this error when I try to load the PDF. Here is the error: command failed: "/usr/local/bin/wkhtmltopdf" "--margin-right" "0.75in" "--page-size" "Letter" "--margin-top" "0.75in" "--margin-bottom" "0.75in" "--encoding" "UTF-8" "--margin-left" "0.75in" "--quiet" "-"

iOS 11 PDFKit not updating annotation position

你。 提交于 2019-12-21 06:37:08
问题 I'm building an app to edit PDFs on iPad. I'm trying to implement the dragging of the annotations with a panGesture recognizer that I added to the superview of the PDFView. The problem is that the new rect bounds of the annotation gets assigned but the changes doesn't reflect on screen. Here is my code: @objc func handlePanGesture(panGesture: UIPanGestureRecognizer) { let touchLocation = panGesture.location(in: pdfView) guard let page = pdfView.page(for: touchLocation, nearest: true) else {

Writing metadata to a pdf using pyobjc

放肆的年华 提交于 2019-12-21 01:58:33
问题 I'm trying to write metadata to a pdf file using the following python code: from Foundation import * from Quartz import * url = NSURL.fileURLWithPath_("test.pdf") pdfdoc = PDFDocument.alloc().initWithURL_(url) assert pdfdoc, "failed to create document" print "reading pdf file" attrs = {} attrs[PDFDocumentTitleAttribute] = "THIS IS THE TITLE" attrs[PDFDocumentAuthorAttribute] = "A. Author and B. Author" PDFDocumentTitleAttribute = "test" pdfdoc.setDocumentAttributes_(attrs) pdfdoc.writeToFile_

PDFAnnotation with PDFAnnotationSubtype equal to .widget is not refreshing its appearance after adding it to PDFPage

谁说胖子不能爱 提交于 2019-12-20 19:42:32
问题 After adding annotation to PDFPage (and rendering it on a screen), there is no way to update its appearance on PDFPage / PDFView . To reproduce the problem: Create PDFAnnotation and add it to the PDFPage : let bounds = CGRect(x: 20.0, y: 20.0, width: 200.0, height: 200.0) let annotation = PDFAnnotation(bounds: b, forType: .widget, withProperties: nil) annotation.widgetFieldType = .text annotation.backgroundColor = .gray annotation.font = .systemFont(ofSize: 18) annotation.widgetStringValue =