Эх сурвалжийг харах

Remove printing rendered markup support

`UIMarkupTextPrintFormatter`:
- doesn't render images
- doesn't work well in generall

Preferred solution: use a WebView to render (and download images etc.) and make a pdf of it. Then, print the pdf.

Signed-off-by: Henrik Storch <henrik.storch@nextcloud.com>
Henrik Storch 3 жил өмнө
parent
commit
4dfd20e7a3

+ 1 - 7
iOSClient/Main/NCFunctionCenter.swift

@@ -306,13 +306,7 @@ import SVGKit
         }
 
         guard let text = String(data: data, encoding: .utf8) else { return }
-        let formatter: UIPrintFormatter
-        if metadata.classFile == "text/html" {
-            let textWithoutNewlines = text.replacingOccurrences(of: "\n", with: "<br />")
-            formatter = UIMarkupTextPrintFormatter(markupText: textWithoutNewlines)
-        } else {
-            formatter = UISimpleTextPrintFormatter(text: text)
-        }
+        let formatter = UISimpleTextPrintFormatter(text: text)
         formatter.perPageContentInsets.top = 72
         formatter.perPageContentInsets.bottom = 72
         formatter.perPageContentInsets.left = 72