Previously, the pdf address was directly loaded with WKWebview, and the specific implementation was to load it by splicing the url path of the pdf through the remote pdfviewer (which can be understood as the pdf viewing page on the web side), as follows:
However, due to cross-domain problems, cookie need to be injected, and the speed of parsing and loading pdf from the remote end has been slow, so I want to try other methods.
A brief investigation process ...
Research related links:
Problems and Solutions of Displaying pdf Signature in iOS
Research on realizing PDF reading function by iOS
Visit the tutorial for direct reference: iOS uses pdf.js to open pdf files.
After referring to the above steps, I still can't display the electronic signature (signature). After viewing the problems on pdf.js, I found the following related problems:
Among them, Osukaru proposed the solution in #4743:
In line 60 1 (current version) of src/core/annotation.js.
(Later, during the inquiry, it was found that the same solution was also mentioned in how to display the electronic signature of pdf files with PDF.js).
Modify the src/core/annotation.js file in clone PDF.js, and then use PDF.js to open the pdf file according to iOS.
Reconstruction execution
Then enter the project, the final effect:
Note that the/security/samplesignedpfdocument.pdf provided above is not used for verification, because it will crash and throw the webactiondisablingcalayer delegate will be deleted]: Unrecognized selector sending error.