{"id":374183,"date":"2024-05-21T05:54:07","date_gmt":"2024-05-21T05:54:07","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=374183"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=374183","title":{"rendered":"<span>\u0413\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c \u043e\u0442\u0447\u0435\u0442\u044b PDF \u043d\u0430 Android \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c HTML \u0438 WebView \u0432 \u0444\u043e\u043d\u0435<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/6fa\/856\/6ad\/6fa8566ad1dd1f30c5b6e5a48418a90b.png\" width=\"480\" height=\"283\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/6fa\/856\/6ad\/6fa8566ad1dd1f30c5b6e5a48418a90b.png\"\/><\/figure>\n<h2>Introduction \u0432 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443<\/h2>\n<p>\u0421\u0435\u0440\u0432\u0438\u0441, \u043f\u0440\u0435\u0436\u0434\u0435 \u0432\u0441\u0435\u0433\u043e, \u0434\u043e\u043b\u0436\u0435\u043d \u0440\u0435\u0448\u0430\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u0427\u0430\u0441\u0442\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u043e\u043b\u0436\u043d\u044b \u0434\u0435\u043b\u0430\u0442\u044c \u0442\u043e, \u0447\u0442\u043e, \u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0431\u044b, \u0434\u043e\u043b\u0436\u043d\u043e \u043b\u043e\u0436\u0438\u0442\u044c\u0441\u044f \u043d\u0430 \u043f\u043b\u0435\u0447\u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0445 API. \u0422\u0430\u043a, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u043e \u0432 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435. \u0421\u0435\u0440\u0432\u0438\u0441 \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u043e\u0442\u0447\u0435\u0442\u044b, \u0443\u0434\u043e\u0431\u043d\u043e \u0438\u0445 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u0438\u0442\u044c, \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u0437\u0430\u0434\u0430\u0447\u0438 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0430\u043c. \u0412 \u0440\u0430\u043c\u043a\u0430\u0445 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u0445\u043e\u0447\u0443 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u0440\u043e \u043d\u0430\u0448 \u043e\u043f\u044b\u0442 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 PDF-\u043e\u0442\u0447\u0435\u0442\u043e\u0432 \u043d\u0430 Android-\u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e. \u041f\u0440\u0438\u044f\u0442\u043d\u043e\u0433\u043e \u0447\u0442\u0435\u043d\u0438\u044f!<\/p>\n<h3>\u041a\u0430\u043a \u0432\u0441\u0435 \u0431\u044b\u043b\u043e\u2026<\/h3>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/9ed\/a13\/da2\/9eda13da2e9400fd3043a3e064598144.png\" alt=\"\u0420\u0430\u0431\u043e\u0442\u0430 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0434\u043e \" title=\"\u0420\u0430\u0431\u043e\u0442\u0430 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0434\u043e \" width=\"1020\" height=\"632\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/9ed\/a13\/da2\/9eda13da2e9400fd3043a3e064598144.png\"\/><\/p>\n<div><figcaption>\u0420\u0430\u0431\u043e\u0442\u0430 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0434\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439<\/figcaption><\/div>\n<\/figure>\n<p><strong>\u041a\u0435\u0439\u0441 \u043c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c:<\/strong> \u043a\u043b\u0438\u0435\u043d\u0442 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0444\u043e\u0440\u043c\u0443 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 (\u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u044f \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u0443\u044e \u0444\u043e\u0440\u043c\u0443 \u043e\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u0430); \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f JSON \u0438 MediaPart \u0444\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0438 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440; \u0441\u0435\u0440\u0432\u0435\u0440 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u043e\u0442\u0447\u0435\u0442 PDF \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u044d\u0442\u043e \u043a\u043b\u0438\u0435\u043d\u0442\u0443\/\u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0432 \u0430\u0434\u043c\u0438\u043d\u043a\u0435.<\/p>\n<h3>\u0427\u0442\u043e \u043d\u0435 \u0442\u0430\u043a?<\/h3>\n<p>\u041d\u0430 \u043c\u0435\u0441\u0442\u0430\u0445 \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u043a\u043e\u0432 \u0447\u0430\u0441\u0442\u043e \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0418\u043d\u0442\u0435\u0440\u043d\u0435\u0442 (\u0438 \u0432\u043e\u043e\u0431\u0449\u0435 \u043b\u044e\u0431\u0430\u044f \u0441\u0432\u044f\u0437\u044c), \u043e\u0442\u0447\u0435\u0442\u044b \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0444\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0439, \u0441\u0435\u0440\u0432\u0435\u0440 \u043c\u043e\u0436\u0435\u0442 \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c, \u0438 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u043a \u0445\u043e\u0447\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u043e\u0442\u0447\u0435\u0442 \u0443 \u0441\u0435\u0431\u044f \u043d\u0430 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0435 \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u043e\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u0432\u0441\u0435\u0439 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0439 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b.<\/p>\n<p>\u0421\u0430\u043c\u0438 \u0437\u0430\u043a\u0430\u0437\u0447\u0438\u043a\u0438 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u043b\u0438 \u0441\u0432\u043e\u0438 &#171;\u0433\u0435\u043d\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u0438\u0434\u0435\u0438&#187; \u043f\u043e \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044e \u0441\u0435\u0440\u0432\u0438\u0441\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u0438\u0441\u043f\u0440\u0430\u0432\u043d\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043b\u0438. \u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u0430\u0436\u0435 \u043e\u0431\u0437\u0430\u0432\u0435\u043b\u043e\u0441\u044c \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440\u043e\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u043a\u0443\u0434\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043e\u0442\u0447\u0435\u0442, \u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u0438\u043d\u0441\u0442\u0430\u043d\u0441\u0430\u043c\u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432, \u043d\u043e \u044d\u0442\u043e \u0441\u043e\u0432\u0441\u0435\u043c \u0434\u0440\u0443\u0433\u0430\u044f \u0438\u0441\u0442\u043e\u0440\u0438\u044f\u2026 <strong>\u041e\u043f\u0438\u0441\u0430\u043d\u043d\u0443\u044e \u0432\u044b\u0448\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u043c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u043e\u043c \u0437\u0430\u0434\u0430\u0447\u0438 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043e\u0442\u0447\u0435\u0442\u043e\u0432 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435-\u043a\u043b\u0438\u0435\u043d\u0442 \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0435\u0439 \u0441\u0435\u0440\u0432\u0435\u0440\u0443 \u0443\u0436\u0435 \u0433\u043e\u0442\u043e\u0432\u043e\u0433\u043e PDF.<\/strong><\/p>\n<p><em>\u041d\u043e\u0432\u0430\u044f \u0441\u0445\u0435\u043c\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/em><\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/f73\/47c\/db1\/f7347cdb18afe891cda06b22f8147cd4.png\" alt=\"\u0420\u0430\u0431\u043e\u0442\u0430 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u043f\u043e\u0441\u043b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439\" title=\"\u0420\u0430\u0431\u043e\u0442\u0430 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u043f\u043e\u0441\u043b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439\" width=\"848\" height=\"494\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f73\/47c\/db1\/f7347cdb18afe891cda06b22f8147cd4.png\"\/><\/p>\n<div><figcaption>\u0420\u0430\u0431\u043e\u0442\u0430 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u043f\u043e\u0441\u043b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439<\/figcaption><\/div>\n<\/figure>\n<h2>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/h2>\n<p>\u041d\u0438\u0436\u0435 \u043f\u0440\u043e\u0431\u0435\u0436\u0438\u043c\u0441\u044f \u043f\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f. \u0420\u0430\u0441\u0441\u043a\u0430\u0436\u0443, \u043a\u0430\u043a \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u043b\u0438 \u043c\u044b, \u0447\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0438 \u043a\u0430\u043a\u0438\u0435 \u0435\u0441\u0442\u044c \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u044b.<\/p>\n<h3>\u0427\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 PDF?<\/h3>\n<h4>\u0410\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u044b<\/h4>\n<p>\u0414\u043b\u044f \u0442\u0435\u0445, \u043a\u0442\u043e \u0445\u043e\u0447\u0435\u0442 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0434\u0440\u0443\u0433\u0438\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b, \u0432\u043e\u0442, \u043d\u0430\u0432\u0435\u0440\u043d\u043e\u0435, \u0441\u0430\u043c\u044b\u0435 \u0431\u0430\u0437\u043e\u0432\u044b\u0435, \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b.<\/p>\n<figure class=\"float\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/329\/c24\/42b\/329c2442ba5ff4867f668177cc4d1565.png\" alt=\"PDFDocument\" title=\"PDFDocument\" width=\"281\" height=\"138\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/329\/c24\/42b\/329c2442ba5ff4867f668177cc4d1565.png\"\/><\/p>\n<div><figcaption><a href=\"https:\/\/developer.android.com\/reference\/kotlin\/android\/graphics\/pdf\/PdfDocument\" rel=\"noopener noreferrer nofollow\"><strong>PDFDocument<\/strong><\/a><\/figcaption><\/div>\n<\/figure>\n<p><a href=\"https:\/\/developer.android.com\/reference\/kotlin\/android\/graphics\/pdf\/PdfDocument\" rel=\"noopener noreferrer nofollow\"><strong>PDFDocument<\/strong><\/a> \u2013 \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u0432 android.graphics \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 PDF. \u0411\u0435\u0437 \u0441\u043e\u043c\u043d\u0435\u043d\u0438\u0439, \u0443\u0434\u043e\u0431\u0435\u043d \u0434\u043b\u044f \u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u043d\u0430\u0434\u0435\u0436\u043d\u043e\u0433\u043e \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f PDF, \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432. \u0412 \u043d\u0430\u0448\u0435\u043c \u043a\u0435\u0439\u0441\u0435 \u043d\u0435\u0430\u043a\u0442\u0443\u0430\u043b\u0435\u043d, \u0442\u0430\u043a \u043a\u0430\u043a \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043d\u0438\u0437\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438, \u0442\u044f\u0436\u0435\u043b\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c\u0438 \u0444\u0430\u0439\u043b\u0430\u043c\u0438 \u0438 \u0442\u0435\u043c \u0431\u043e\u043b\u0435\u0435 \u0431\u044b\u0441\u0442\u0440\u043e \u043c\u0435\u043d\u044f\u0442\u044c \u0438\u0445 \u0444\u043e\u0440\u043c\u0430\u0442.  <\/p>\n<figure class=\"float\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/c3a\/f0a\/199\/c3af0a199bee81bc7227dfb6b0bfeb23.png\" alt=\"PDFBox\" title=\"PDFBox\" width=\"281\" height=\"138\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c3a\/f0a\/199\/c3af0a199bee81bc7227dfb6b0bfeb23.png\"\/><\/p>\n<div><figcaption><a href=\"https:\/\/pdfbox.apache.org\/\" rel=\"noopener noreferrer nofollow\"><strong>PDFBox<\/strong><\/a><\/figcaption><\/div>\n<\/figure>\n<p><a href=\"https:\/\/pdfbox.apache.org\/\" rel=\"noopener noreferrer nofollow\"><strong>PDFBox<\/strong><\/a> \u2013 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u043e\u0442 Apache. \u0412 \u0442\u0435\u043e\u0440\u0438\u0438 \u043e\u043d\u0438 \u0433@\u0432\u043d\u0430 \u043d\u0435 \u0441\u0434\u0435\u043b\u0430\u044e\u0442, \u043d\u043e \u0432 \u043d\u0430\u0448\u0435\u043c \u043a\u0435\u0439\u0441\u0435 \u044d\u0442\u043e too much. \u0423\u0434\u043e\u0431\u043d\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u043c\u0438 \u0438 \u0442\u0435\u043a\u0441\u0442\u043e\u043c. \u041d\u0435 \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u0435 \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u043a\u0430\u0440\u0442\u0438\u043d\u043e\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0432 \u043e\u0442\u0447\u0435\u0442\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e (\u0441\u0432\u044b\u0448\u0435 200).<\/p>\n<figure class=\"float\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/810\/d17\/6fa\/810d176fa022616e947c98275a482956.png\" alt=\"iText\" title=\"iText\" width=\"281\" height=\"138\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/810\/d17\/6fa\/810d176fa022616e947c98275a482956.png\"\/><\/p>\n<div><figcaption><a href=\"https:\/\/github.com\/itext\/itext-java\" rel=\"noopener noreferrer nofollow\"><strong>iText<\/strong><\/a><\/figcaption><\/div>\n<\/figure>\n<p><a href=\"https:\/\/github.com\/itext\/itext-java\" rel=\"noopener noreferrer nofollow\"><strong>iText<\/strong><\/a> \u2013 \u043d\u043e\u0432\u0435\u0435 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439, \u0441 \u0445\u043e\u0440\u043e\u0448\u0438\u043c \u043a\u043e\u043c\u044c\u044e\u043d\u0438\u0442\u0438. \u041d\u0435 \u0432\u044b\u0431\u0440\u0430\u043b\u0438 \u0435\u0433\u043e \u043f\u043e \u0442\u0435\u043c \u0436\u0435 \u043f\u0440\u0438\u0447\u0438\u043d\u0430\u043c, \u0447\u0442\u043e \u0438 PDFBox. \u0412 \u0446\u0435\u043b\u043e\u043c \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0443\u0434\u043e\u0431\u043d\u0430\u044f, \u0446\u0435\u043b\u043e\u0441\u0442\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430, \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u043a\u0435\u0439\u0441\u0430\u0445 \u044f \u0431\u044b \u043d\u0430\u0447\u0438\u043d\u0430\u043b \u0441 \u043d\u0435\u0451.<\/p>\n<h4>\u041d\u0430\u0448 \u0432\u044b\u0431\u043e\u0440<\/h4>\n<p>\u0410 \u0432\u043e\u0442 \u043d\u0430\u0448 \u0432\u044b\u0431\u043e\u0440 \u043f\u0430\u043b \u043d\u0430 \u0431\u043e\u043b\u0435\u0435 \u043a\u043e\u0441\u0442\u044b\u043b\u044c\u043d\u043e\u0435 (\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e), \u043d\u043e \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0435 \u0438 \u0431\u044b\u0441\u0442\u0440\u043e\u0435 \u0432 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u0435. \u0410 \u0438\u043c\u0435\u043d\u043d\u043e, \u043f\u043e \u043a\u0443\u0441\u043a\u0430\u043c \u0442\u0435\u043c\u043f\u043b\u0435\u0439\u0442\u043e\u0432 \u0441\u043e\u0437\u0434\u0430\u0435\u043c HTML \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442, \u043f\u0440\u043e\u0433\u043e\u043d\u044f\u0435\u043c \u0447\u0435\u0440\u0435\u0437 <code>WebView<\/code>  \u0434\u043b\u044f \u043f\u0435\u0447\u0430\u0442\u0438 \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 PDF. <\/p>\n<p><strong>\u041f\u043e\u0447\u0435\u043c\u0443 \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a?<\/strong><\/p>\n<ol>\n<li>\n<p><strong>\u041d\u0435 \u0441 \u043d\u0443\u043b\u044f.<\/strong> \u0423 \u043d\u0430\u0441 \u0443\u0436\u0435 \u0431\u044b\u043b \u043d\u0430\u043b\u0430\u0436\u0435\u043d\u043d\u044b\u0439 \u043f\u043e\u0445\u043e\u0436\u0438\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 (\u0447\u0438\u0442\u0430\u0439 introduction). \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0443\u0436\u0435 \u0431\u044b\u043b\u0438 \u0448\u0430\u0431\u043b\u043e\u043d\u044b HTML \u0438 CSS.<\/p>\n<\/li>\n<li>\n<p><strong>\u0423\u0434\u043e\u0431\u0441\u0442\u0432\u043e \u0438 \u0433\u0438\u0431\u043a\u043e\u0441\u0442\u044c. <\/strong>HTML \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0438 \u0433\u0438\u0431\u043a\u0438\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u0441\u0442\u0438\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430. \u041e\u043d \u0441\u0430\u043c \u0430\u0434\u0430\u043f\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043f\u043e\u0434 \u043f\u0435\u0447\u0430\u0442\u044c \u043d\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 \u0444\u043e\u0440\u043c\u0430\u0442\u0430\u0445 \u0431\u0443\u043c\u0430\u0433\u0438. \u041f\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u0434\u0438\u0437\u0430\u0439\u043d\u0430 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u043b\u0435\u0433\u043a\u043e \u043f\u043e\u043f\u0440\u0430\u0432\u0438\u0442\u044c CSS.<\/p>\n<\/li>\n<li>\n<p><strong>\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u043c\u0438.<\/strong> \u0412 HTML \u043f\u0440\u043e\u0441\u0442\u043e \u0443\u0434\u043e\u0431\u043d\u0435\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430\u043c\u0438: \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c, \u0437\u043d\u0430\u043a\u043e\u043c\u0430\u044f \u0441\u0442\u0438\u043b\u0438\u0437\u0430\u0446\u0438\u044f, \u0430\u0434\u0430\u043f\u0442\u0438\u0432. \u0423\u0434\u043e\u0431\u043d\u043e \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c URI \u0434\u043e \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438, \u0432\u0441\u044e \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u0443\u044e \u0440\u0430\u0431\u043e\u0442\u0443 \u0431\u0435\u0440\u0435\u0442 \u043d\u0430 \u0441\u0435\u0431\u044f <code>WebView<\/code>.<\/p>\n<\/li>\n<li>\n<p><strong>\u0411\u044b\u0441\u0442\u0440\u044b\u0439 \u0441\u0442\u0430\u0440\u0442. <\/strong>\u041f\u0440\u043e\u0435\u043a\u0442 \u0443\u0436\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u043b\u0441\u044f \u0432 \u043f\u0440\u043e\u0434\u0435, \u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u043d\u0443\u0436\u0435\u043d \u0441\u0440\u043e\u0447\u043d\u043e. \u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u0440\u0430\u043d\u0435\u0435 \u0437\u043d\u0430\u043a\u043e\u043c\u044b\u043c <code>WebView<\/code> \u0438 HTML \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442 \u0442\u0440\u0443\u0434\u043e\u0447\u0430\u0441\u044b.<\/p>\n<\/li>\n<li>\n<p><strong>\u041f\u0440\u0435\u0434\u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440. <\/strong>\u041c\u043e\u0436\u043d\u043e \u0443\u0434\u043e\u0431\u043d\u043e \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0435\u0434\u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440 \u043f\u0440\u044f\u043c\u043e \u0438\u0437 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0412 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u043c\u044b \u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u043e\u0442\u043a\u0430\u0437\u0430\u043b\u0438\u0441\u044c, \u0442\u0430\u043a \u043a\u0430\u043a \u0440\u0430\u043d\u0435\u0435 \u0443\u0436\u0435 \u0431\u044b\u043b\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u043a\u0440\u0430\u0442\u043a\u0430\u044f \u0441\u0432\u043e\u0434\u043a\u0430 \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430 \u043e\u0442\u0447\u0435\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0432\u043f\u043e\u043b\u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u0435\u0442.<\/p>\n<\/li>\n<\/ol>\n<p>\u0412 \u0446\u0435\u043b\u043e\u043c \u0441\u043e\u0432\u043e\u043a\u0443\u043f\u043d\u043e\u0441\u0442\u044c \u044d\u0442\u0438\u0445 \u0444\u0430\u043a\u0442\u043e\u0440\u043e\u0432 \u043f\u043e\u0432\u043b\u0438\u044f\u043b\u0430 \u043d\u0430 \u0432\u044b\u0431\u043e\u0440 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438.<\/p>\n<blockquote>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043a\u043e\u0434\u0430 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b. \u0421\u0442\u0430\u0442\u044c\u044f \u043d\u0435 \u043f\u0440\u0435\u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0446\u0435\u043b\u044c \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0435 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u044b. \u0414\u043b\u044f \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043b\u0443\u0447\u0448\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b, \u0440\u0430\u0437\u0431\u0438\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0443 \u0438 \u0442.\u0434.\u2757\ufe0f<\/p>\n<\/blockquote>\n<h3>\u041d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u0441 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0438 HTML<\/h3>\n<p>\u0420\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c <code>PdfGenerator<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c <code>Context<\/code> \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 <code>WebView<\/code>, \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435\u043c \u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c\u0438.<\/p>\n<p>\u0421\u0430\u043c \u043a\u043b\u0430\u0441\u0441 \u0434\u043e\u043b\u0436\u0435\u043d \u0438\u043c\u0435\u0442\u044c \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430, \u043a\u0443\u0434\u0430 \u043c\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438 \u0444\u0430\u0439\u043b \u0434\u043b\u044f \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f. \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u044d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439.<\/p>\n<pre><code class=\"kotlin\">class PdfGenerator(private val context: Context) {   private val htmlToPdfConvertor = HtmlToPdfConvertor(context)   \/\/ \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f   suspend fun generateExpertAct(       act: ActSave,       images: List&lt;File>,       outFile: File   ): Result&lt;Unit> { &lt;..> }      \/\/ \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 html \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430   private fun generateExpertActHtml(       act: ActSave,       images: List&lt;File>   ): String { &lt;..> }      &lt;..>      companion object {       const val TAG: String = \"PdfGenerator\"          private val PREFIX = \"\"\"             &lt;!DOCTYPE html>             &lt;html lang=\"ru\">             &lt;head>                 &lt;meta charset=\"UTF-8\">                 &lt;title>Title&lt;\/title>             &lt;\/head>                      \"\"\".trimIndent()          private val SUFFIX = \"\"\"             &lt;\/html>                      \"\"\".trimIndent()                &lt;..>   } }<\/code><\/pre>\n<p><a href=\"https:\/\/gist.github.com\/stakancheck\/2f26fc4897dacc765261241c1fd39848\" rel=\"noopener noreferrer nofollow\">\u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430 \u043d\u0430 Gist<\/a><\/p>\n<h3>\u0413\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c PDF<\/h3>\n<p>\u0412 \u043a\u043e\u0434\u0435 \u0432\u044b\u0448\u0435 \u0435\u0441\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0438\u043d\u0441\u0442\u0430\u043d\u0441\u0430 <code>HtmlToPdfConvertor<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 <code>WebView<\/code> \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435\u043c. \u041d\u0430\u043f\u0438\u0441\u0430\u043d \u043e\u043d \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043a\u043e\u043b\u0431\u0435\u043a\u043e\u0432, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u0442\u044c \u0435\u0433\u043e \u0432 suspend \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>suspendCoroutine<\/code>. \u041f\u0440\u0438\u043c\u0435\u0440 \u043d\u0438\u0436\u0435:<\/p>\n<pre><code class=\"kotlin\">suspend fun generateExpertAct(   act: ActSave,   images: List&lt;File>,   outFile: File ): Result&lt;Unit> {   return suspendCoroutine { continuation ->     Handler(Looper.getMainLooper()).post {       htmlToPdfConvertor.convert(         pdfLocation = outFile,         htmlString = generateExpertActHtml(           act = act,           images = images         ),         onPdfGenerationFailed = { exception ->           continuation.resume(Result.failure(exception))         },         onPdfGenerated = {           continuation.resume(Result.success(Unit))         }       )     }   } }<\/code><\/pre>\n<p><a href=\"https:\/\/gist.github.com\/stakancheck\/d5039ea7f24e86387fd4bd8f29584dff\" rel=\"noopener noreferrer nofollow\">\u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430 \u043d\u0430 Gist<\/a><\/p>\n<h3>\u041e\u0431\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0432\u0441\u0435 \u0432 Worker<\/h3>\n<p>\u0414\u043b\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0441\u0442\u0430\u043b\u043e \u0432\u0430\u0436\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u0434\u0430\u0447\u0438 \u043f\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0435 \u0438 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u0438\u0441\u044c \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u043b\u0438\u0441\u044c \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u0442\u043e\u0438\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c <code>Worker<\/code>. <\/p>\n<p>\u0412 \u043a\u043e\u0434\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 <code>Repository<\/code> \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0430 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u043c\u0438, \u0447\u0442\u043e\u0431\u044b \u0431\u044b\u043b\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043f\u0440\u043e \u0444\u043e\u043d\u043e\u0432\u0443\u044e \u0440\u0430\u0431\u043e\u0442\u0443 \u043c\u043e\u0436\u043d\u043e <a href=\"https:\/\/developer.android.com\/reference\/androidx\/work\/WorkManager\" rel=\"noopener noreferrer nofollow\">\u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438.<\/a><\/p>\n<p><a href=\"https:\/\/gist.github.com\/stakancheck\/f8dbc666ef97b97bf680e8605e28b587\" rel=\"noopener noreferrer nofollow\">\u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430 \u043d\u0430 Gist<\/a><\/p>\n<h4>\u0420\u0430\u0431\u043e\u0442\u0430 WebView<\/h4>\n<p>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442\u0435 <code>WebView<\/code> (\u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0435\u0434\u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430) \u0438 \u0445\u043e\u0442\u0438\u0442\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e PDF \u0432 \u0444\u043e\u043d\u0435 (<code>Worker<\/code>), \u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e &#171;\u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u044f&#187;. <\/p>\n<p>\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 <code>WebView<\/code> \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0432 \u0431\u043b\u043e\u043a\u0435 <code>Handler(Looper.getMainLooper()).post<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u0434\u0430 \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u043f\u043e\u0442\u043e\u043a\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0412 Android, \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043f\u043e\u0442\u043e\u043a \u0442\u0430\u043a\u0436\u0435 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f UI \u043f\u043e\u0442\u043e\u043a\u043e\u043c. <\/p>\n<h2>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442<\/h2>\n<p>\u042d\u0442\u0443 \u0437\u0430\u0434\u0430\u0447\u0443 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0440\u0435\u0448\u0438\u0442\u044c \u043d\u0435\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u043c \u043c\u0435\u0442\u043e\u0434\u043e\u043c. \u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u043d\u0435\u043b\u044c\u0437\u044f \u043d\u0430\u0437\u0432\u0430\u0442\u044c \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u043e\u0432\u0430\u043d\u043d\u044b\u043c, \u043b\u0443\u0447\u0448\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438. \u041d\u043e \u0435\u0441\u043b\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431, \u0442\u043e, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043c\u043e\u0439 \u043e\u043f\u044b\u0442 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u0435\u043d.<\/p>\n<p>\u0412 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u044d\u0442\u043e\u0442 \u043f\u043e\u0434\u0445\u043e\u0434 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e \u0438 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u043e. \u041e\u0442\u0447\u0435\u0442\u044b \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0442 \u0431\u043e\u043b\u0435\u0435 100 \u0444\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0439, \u0432\u0441\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0431\u0435\u0437 \u043e\u0448\u0438\u0431\u043e\u043a. \u042d\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u043b\u043e \u043d\u0430\u043c \u0431\u044b\u0441\u0442\u0440\u043e \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u0432\u0438\u0434 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043f\u043e\u0434 \u043d\u043e\u0432\u044b\u0439 \u0441\u0442\u0438\u043b\u044c \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0438\u043d\u0444\u043e\u0433\u0440\u0430\u0444\u0438\u043a\u0443 Plotly, \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0432 JS. <\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/809141\/\"> https:\/\/habr.com\/ru\/articles\/809141\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"\"><\/figure>\n<h2>Introduction \u0432 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443<\/h2>\n<p>\u0421\u0435\u0440\u0432\u0438\u0441, \u043f\u0440\u0435\u0436\u0434\u0435 \u0432\u0441\u0435\u0433\u043e, \u0434\u043e\u043b\u0436\u0435\u043d \u0440\u0435\u0448\u0430\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u0427\u0430\u0441\u0442\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u043e\u043b\u0436\u043d\u044b \u0434\u0435\u043b\u0430\u0442\u044c \u0442\u043e, \u0447\u0442\u043e, \u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0431\u044b, \u0434\u043e\u043b\u0436\u043d\u043e \u043b\u043e\u0436\u0438\u0442\u044c\u0441\u044f \u043d\u0430 \u043f\u043b\u0435\u0447\u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0445 API. \u0422\u0430\u043a, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u043e \u0432 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435. \u0421\u0435\u0440\u0432\u0438\u0441 \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u043e\u0442\u0447\u0435\u0442\u044b, \u0443\u0434\u043e\u0431\u043d\u043e \u0438\u0445 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u0438\u0442\u044c, \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u0437\u0430\u0434\u0430\u0447\u0438 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0430\u043c. \u0412 \u0440\u0430\u043c\u043a\u0430\u0445 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u0445\u043e\u0447\u0443 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u0440\u043e \u043d\u0430\u0448 \u043e\u043f\u044b\u0442 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 PDF-\u043e\u0442\u0447\u0435\u0442\u043e\u0432 \u043d\u0430 Android-\u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e. \u041f\u0440\u0438\u044f\u0442\u043d\u043e\u0433\u043e \u0447\u0442\u0435\u043d\u0438\u044f!<\/p>\n<h3>\u041a\u0430\u043a \u0432\u0441\u0435 \u0431\u044b\u043b\u043e\u2026<\/h3>\n<figure class=\"full-width\">\n<div><figcaption>\u0420\u0430\u0431\u043e\u0442\u0430 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0434\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439<\/figcaption><\/div>\n<\/figure>\n<p><strong>\u041a\u0435\u0439\u0441 \u043c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c:<\/strong> \u043a\u043b\u0438\u0435\u043d\u0442 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0444\u043e\u0440\u043c\u0443 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 (\u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u044f \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u0443\u044e \u0444\u043e\u0440\u043c\u0443 \u043e\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u0430); \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f JSON \u0438 MediaPart \u0444\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0438 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440; \u0441\u0435\u0440\u0432\u0435\u0440 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u043e\u0442\u0447\u0435\u0442 PDF \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u044d\u0442\u043e \u043a\u043b\u0438\u0435\u043d\u0442\u0443\/\u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0432 \u0430\u0434\u043c\u0438\u043d\u043a\u0435.<\/p>\n<h3>\u0427\u0442\u043e \u043d\u0435 \u0442\u0430\u043a?<\/h3>\n<p>\u041d\u0430 \u043c\u0435\u0441\u0442\u0430\u0445 \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u043a\u043e\u0432 \u0447\u0430\u0441\u0442\u043e \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0418\u043d\u0442\u0435\u0440\u043d\u0435\u0442 (\u0438 \u0432\u043e\u043e\u0431\u0449\u0435 \u043b\u044e\u0431\u0430\u044f \u0441\u0432\u044f\u0437\u044c), \u043e\u0442\u0447\u0435\u0442\u044b \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0444\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0439, \u0441\u0435\u0440\u0432\u0435\u0440 \u043c\u043e\u0436\u0435\u0442 \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c, \u0438 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u043a \u0445\u043e\u0447\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u043e\u0442\u0447\u0435\u0442 \u0443 \u0441\u0435\u0431\u044f \u043d\u0430 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0435 \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u043e\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u0432\u0441\u0435\u0439 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0439 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b.<\/p>\n<p>\u0421\u0430\u043c\u0438 \u0437\u0430\u043a\u0430\u0437\u0447\u0438\u043a\u0438 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u043b\u0438 \u0441\u0432\u043e\u0438 &#171;\u0433\u0435\u043d\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u0438\u0434\u0435\u0438&#187; \u043f\u043e \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044e \u0441\u0435\u0440\u0432\u0438\u0441\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u0438\u0441\u043f\u0440\u0430\u0432\u043d\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043b\u0438. \u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u0430\u0436\u0435 \u043e\u0431\u0437\u0430\u0432\u0435\u043b\u043e\u0441\u044c \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440\u043e\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u043a\u0443\u0434\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043e\u0442\u0447\u0435\u0442, \u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u0438\u043d\u0441\u0442\u0430\u043d\u0441\u0430\u043c\u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432, \u043d\u043e \u044d\u0442\u043e \u0441\u043e\u0432\u0441\u0435\u043c \u0434\u0440\u0443\u0433\u0430\u044f \u0438\u0441\u0442\u043e\u0440\u0438\u044f\u2026 <strong>\u041e\u043f\u0438\u0441\u0430\u043d\u043d\u0443\u044e \u0432\u044b\u0448\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u043c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u043e\u043c \u0437\u0430\u0434\u0430\u0447\u0438 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043e\u0442\u0447\u0435\u0442\u043e\u0432 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435-\u043a\u043b\u0438\u0435\u043d\u0442 \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0435\u0439 \u0441\u0435\u0440\u0432\u0435\u0440\u0443 \u0443\u0436\u0435 \u0433\u043e\u0442\u043e\u0432\u043e\u0433\u043e PDF.<\/strong><\/p>\n<p><em>\u041d\u043e\u0432\u0430\u044f \u0441\u0445\u0435\u043c\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/em><\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u0420\u0430\u0431\u043e\u0442\u0430 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u043f\u043e\u0441\u043b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439<\/figcaption><\/div>\n<\/figure>\n<h2>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/h2>\n<p>\u041d\u0438\u0436\u0435 \u043f\u0440\u043e\u0431\u0435\u0436\u0438\u043c\u0441\u044f \u043f\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f. \u0420\u0430\u0441\u0441\u043a\u0430\u0436\u0443, \u043a\u0430\u043a \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u043b\u0438 \u043c\u044b, \u0447\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0438 \u043a\u0430\u043a\u0438\u0435 \u0435\u0441\u0442\u044c \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u044b.<\/p>\n<h3>\u0427\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 PDF?<\/h3>\n<h4>\u0410\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u044b<\/h4>\n<p>\u0414\u043b\u044f \u0442\u0435\u0445, \u043a\u0442\u043e \u0445\u043e\u0447\u0435\u0442 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0434\u0440\u0443\u0433\u0438\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b, \u0432\u043e\u0442, \u043d\u0430\u0432\u0435\u0440\u043d\u043e\u0435, \u0441\u0430\u043c\u044b\u0435 \u0431\u0430\u0437\u043e\u0432\u044b\u0435, \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b.<\/p>\n<figure class=\"float\">\n<div><figcaption><a href=\"https:\/\/developer.android.com\/reference\/kotlin\/android\/graphics\/pdf\/PdfDocument\" rel=\"noopener noreferrer nofollow\"><strong>PDFDocument<\/strong><\/a><\/figcaption><\/div>\n<\/figure>\n<p><a href=\"https:\/\/developer.android.com\/reference\/kotlin\/android\/graphics\/pdf\/PdfDocument\" rel=\"noopener noreferrer nofollow\"><strong>PDFDocument<\/strong><\/a> \u2013 \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u0432 android.graphics \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 PDF. \u0411\u0435\u0437 \u0441\u043e\u043c\u043d\u0435\u043d\u0438\u0439, \u0443\u0434\u043e\u0431\u0435\u043d \u0434\u043b\u044f \u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u043d\u0430\u0434\u0435\u0436\u043d\u043e\u0433\u043e \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f PDF, \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432. \u0412 \u043d\u0430\u0448\u0435\u043c \u043a\u0435\u0439\u0441\u0435 \u043d\u0435\u0430\u043a\u0442\u0443\u0430\u043b\u0435\u043d, \u0442\u0430\u043a \u043a\u0430\u043a \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043d\u0438\u0437\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438, \u0442\u044f\u0436\u0435\u043b\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c\u0438 \u0444\u0430\u0439\u043b\u0430\u043c\u0438 \u0438 \u0442\u0435\u043c \u0431\u043e\u043b\u0435\u0435 \u0431\u044b\u0441\u0442\u0440\u043e \u043c\u0435\u043d\u044f\u0442\u044c \u0438\u0445 \u0444\u043e\u0440\u043c\u0430\u0442.  <\/p>\n<figure class=\"float\">\n<div><figcaption><a href=\"https:\/\/pdfbox.apache.org\/\" rel=\"noopener noreferrer nofollow\"><strong>PDFBox<\/strong><\/a><\/figcaption><\/div>\n<\/figure>\n<p><a href=\"https:\/\/pdfbox.apache.org\/\" rel=\"noopener noreferrer nofollow\"><strong>PDFBox<\/strong><\/a> \u2013 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u043e\u0442 Apache. \u0412 \u0442\u0435\u043e\u0440\u0438\u0438 \u043e\u043d\u0438 \u0433@\u0432\u043d\u0430 \u043d\u0435 \u0441\u0434\u0435\u043b\u0430\u044e\u0442, \u043d\u043e \u0432 \u043d\u0430\u0448\u0435\u043c \u043a\u0435\u0439\u0441\u0435 \u044d\u0442\u043e too much. \u0423\u0434\u043e\u0431\u043d\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u043c\u0438 \u0438 \u0442\u0435\u043a\u0441\u0442\u043e\u043c. \u041d\u0435 \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u0435 \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u043a\u0430\u0440\u0442\u0438\u043d\u043e\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0432 \u043e\u0442\u0447\u0435\u0442\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e (\u0441\u0432\u044b\u0448\u0435 200).<\/p>\n<figure class=\"float\">\n<div><figcaption><a href=\"https:\/\/github.com\/itext\/itext-java\" rel=\"noopener noreferrer nofollow\"><strong>iText<\/strong><\/a><\/figcaption><\/div>\n<\/figure>\n<p><a href=\"https:\/\/github.com\/itext\/itext-java\" rel=\"noopener noreferrer nofollow\"><strong>iText<\/strong><\/a> \u2013 \u043d\u043e\u0432\u0435\u0435 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439, \u0441 \u0445\u043e\u0440\u043e\u0448\u0438\u043c \u043a\u043e\u043c\u044c\u044e\u043d\u0438\u0442\u0438. \u041d\u0435 \u0432\u044b\u0431\u0440\u0430\u043b\u0438 \u0435\u0433\u043e \u043f\u043e \u0442\u0435\u043c \u0436\u0435 \u043f\u0440\u0438\u0447\u0438\u043d\u0430\u043c, \u0447\u0442\u043e \u0438 PDFBox. \u0412 \u0446\u0435\u043b\u043e\u043c \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0443\u0434\u043e\u0431\u043d\u0430\u044f, \u0446\u0435\u043b\u043e\u0441\u0442\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430, \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u043a\u0435\u0439\u0441\u0430\u0445 \u044f \u0431\u044b \u043d\u0430\u0447\u0438\u043d\u0430\u043b \u0441 \u043d\u0435\u0451.<\/p>\n<h4>\u041d\u0430\u0448 \u0432\u044b\u0431\u043e\u0440<\/h4>\n<p>\u0410 \u0432\u043e\u0442 \u043d\u0430\u0448 \u0432\u044b\u0431\u043e\u0440 \u043f\u0430\u043b \u043d\u0430 \u0431\u043e\u043b\u0435\u0435 \u043a\u043e\u0441\u0442\u044b\u043b\u044c\u043d\u043e\u0435 (\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e), \u043d\u043e \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0435 \u0438 \u0431\u044b\u0441\u0442\u0440\u043e\u0435 \u0432 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u0435. \u0410 \u0438\u043c\u0435\u043d\u043d\u043e, \u043f\u043e \u043a\u0443\u0441\u043a\u0430\u043c \u0442\u0435\u043c\u043f\u043b\u0435\u0439\u0442\u043e\u0432 \u0441\u043e\u0437\u0434\u0430\u0435\u043c HTML \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442, \u043f\u0440\u043e\u0433\u043e\u043d\u044f\u0435\u043c \u0447\u0435\u0440\u0435\u0437 <code>WebView<\/code>  \u0434\u043b\u044f \u043f\u0435\u0447\u0430\u0442\u0438 \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 PDF. <\/p>\n<p><strong>\u041f\u043e\u0447\u0435\u043c\u0443 \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a?<\/strong><\/p>\n<ol>\n<li>\n<p><strong>\u041d\u0435 \u0441 \u043d\u0443\u043b\u044f.<\/strong> \u0423 \u043d\u0430\u0441 \u0443\u0436\u0435 \u0431\u044b\u043b \u043d\u0430\u043b\u0430\u0436\u0435\u043d\u043d\u044b\u0439 \u043f\u043e\u0445\u043e\u0436\u0438\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 (\u0447\u0438\u0442\u0430\u0439 introduction). \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0443\u0436\u0435 \u0431\u044b\u043b\u0438 \u0448\u0430\u0431\u043b\u043e\u043d\u044b HTML \u0438 CSS.<\/p>\n<\/li>\n<li>\n<p><strong>\u0423\u0434\u043e\u0431\u0441\u0442\u0432\u043e \u0438 \u0433\u0438\u0431\u043a\u043e\u0441\u0442\u044c. <\/strong>HTML \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0438 \u0433\u0438\u0431\u043a\u0438\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u0441\u0442\u0438\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430. \u041e\u043d \u0441\u0430\u043c \u0430\u0434\u0430\u043f\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043f\u043e\u0434 \u043f\u0435\u0447\u0430\u0442\u044c \u043d\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 \u0444\u043e\u0440\u043c\u0430\u0442\u0430\u0445 \u0431\u0443\u043c\u0430\u0433\u0438. \u041f\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u0434\u0438\u0437\u0430\u0439\u043d\u0430 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u043b\u0435\u0433\u043a\u043e \u043f\u043e\u043f\u0440\u0430\u0432\u0438\u0442\u044c CSS.<\/p>\n<\/li>\n<li>\n<p><strong>\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u043c\u0438.<\/strong> \u0412 HTML \u043f\u0440\u043e\u0441\u0442\u043e \u0443\u0434\u043e\u0431\u043d\u0435\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430\u043c\u0438: \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c, \u0437\u043d\u0430\u043a\u043e\u043c\u0430\u044f \u0441\u0442\u0438\u043b\u0438\u0437\u0430\u0446\u0438\u044f, \u0430\u0434\u0430\u043f\u0442\u0438\u0432. \u0423\u0434\u043e\u0431\u043d\u043e \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c URI \u0434\u043e \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438, \u0432\u0441\u044e \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u0443\u044e \u0440\u0430\u0431\u043e\u0442\u0443 \u0431\u0435\u0440\u0435\u0442 \u043d\u0430 \u0441\u0435\u0431\u044f <code>WebView<\/code>.<\/p>\n<\/li>\n<li>\n<p><strong>\u0411\u044b\u0441\u0442\u0440\u044b\u0439 \u0441\u0442\u0430\u0440\u0442. <\/strong>\u041f\u0440\u043e\u0435\u043a\u0442 \u0443\u0436\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u043b\u0441\u044f \u0432 \u043f\u0440\u043e\u0434\u0435, \u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u043d\u0443\u0436\u0435\u043d \u0441\u0440\u043e\u0447\u043d\u043e. \u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u0440\u0430\u043d\u0435\u0435 \u0437\u043d\u0430\u043a\u043e\u043c\u044b\u043c <code>WebView<\/code> \u0438 HTML \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442 \u0442\u0440\u0443\u0434\u043e\u0447\u0430\u0441\u044b.<\/p>\n<\/li>\n<li>\n<p><strong>\u041f\u0440\u0435\u0434\u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440. <\/strong>\u041c\u043e\u0436\u043d\u043e \u0443\u0434\u043e\u0431\u043d\u043e \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0435\u0434\u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440 \u043f\u0440\u044f\u043c\u043e \u0438\u0437 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0412 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u043c\u044b \u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u043e\u0442\u043a\u0430\u0437\u0430\u043b\u0438\u0441\u044c, \u0442\u0430\u043a \u043a\u0430\u043a \u0440\u0430\u043d\u0435\u0435 \u0443\u0436\u0435 \u0431\u044b\u043b\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u043a\u0440\u0430\u0442\u043a\u0430\u044f \u0441\u0432\u043e\u0434\u043a\u0430 \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430 \u043e\u0442\u0447\u0435\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0432\u043f\u043e\u043b\u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u0435\u0442.<\/p>\n<\/li>\n<\/ol>\n<p>\u0412 \u0446\u0435\u043b\u043e\u043c \u0441\u043e\u0432\u043e\u043a\u0443\u043f\u043d\u043e\u0441\u0442\u044c \u044d\u0442\u0438\u0445 \u0444\u0430\u043a\u0442\u043e\u0440\u043e\u0432 \u043f\u043e\u0432\u043b\u0438\u044f\u043b\u0430 \u043d\u0430 \u0432\u044b\u0431\u043e\u0440 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438.<\/p>\n<blockquote>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043a\u043e\u0434\u0430 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b. \u0421\u0442\u0430\u0442\u044c\u044f \u043d\u0435 \u043f\u0440\u0435\u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0446\u0435\u043b\u044c \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0435 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u044b. \u0414\u043b\u044f \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043b\u0443\u0447\u0448\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b, \u0440\u0430\u0437\u0431\u0438\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0443 \u0438 \u0442.\u0434.\u2757\ufe0f<\/p>\n<\/blockquote>\n<h3>\u041d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u0441 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0438 HTML<\/h3>\n<p>\u0420\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c <code>PdfGenerator<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c <code>Context<\/code> \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 <code>WebView<\/code>, \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435\u043c \u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c\u0438.<\/p>\n<p>\u0421\u0430\u043c \u043a\u043b\u0430\u0441\u0441 \u0434\u043e\u043b\u0436\u0435\u043d \u0438\u043c\u0435\u0442\u044c \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430, \u043a\u0443\u0434\u0430 \u043c\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438 \u0444\u0430\u0439\u043b \u0434\u043b\u044f \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f. \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u044d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439.<\/p>\n<pre><code class=\"kotlin\">class PdfGenerator(private val context: Context) {   private val htmlToPdfConvertor = HtmlToPdfConvertor(context)   \/\/ \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f   suspend fun generateExpertAct(       act: ActSave,       images: List&lt;File>,       outFile: File   ): Result&lt;Unit> { &lt;..> }      \/\/ \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 html \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430   private fun generateExpertActHtml(       act: ActSave,       images: List&lt;File>   ): String { &lt;..> }      &lt;..>      companion object {       const val TAG: String = \"PdfGenerator\"          private val PREFIX = \"\"\"             &lt;!DOCTYPE html>             &lt;html lang=\"ru\">             &lt;head>                 &lt;meta charset=\"UTF-8\">                 &lt;title>Title&lt;\/title>             &lt;\/head>                      \"\"\".trimIndent()          private val SUFFIX = \"\"\"             &lt;\/html>                      \"\"\".trimIndent()                &lt;..>   } }<\/code><\/pre>\n<p><a href=\"https:\/\/gist.github.com\/stakancheck\/2f26fc4897dacc765261241c1fd39848\" rel=\"noopener noreferrer nofollow\">\u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430 \u043d\u0430 Gist<\/a><\/p>\n<h3>\u0413\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c PDF<\/h3>\n<p>\u0412 \u043a\u043e\u0434\u0435 \u0432\u044b\u0448\u0435 \u0435\u0441\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0438\u043d\u0441\u0442\u0430\u043d\u0441\u0430 <code>HtmlToPdfConvertor<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 <code>WebView<\/code> \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435\u043c. \u041d\u0430\u043f\u0438\u0441\u0430\u043d \u043e\u043d \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043a\u043e\u043b\u0431\u0435\u043a\u043e\u0432, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u0442\u044c \u0435\u0433\u043e \u0432 suspend \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>suspendCoroutine<\/code>. \u041f\u0440\u0438\u043c\u0435\u0440 \u043d\u0438\u0436\u0435:<\/p>\n<pre><code class=\"kotlin\">suspend fun generateExpertAct(   act: ActSave,   images: List&lt;File>,   outFile: File ): Result&lt;Unit> {   return suspendCoroutine { continuation ->     Handler(Looper.getMainLooper()).post {       htmlToPdfConvertor.convert(         pdfLocation = outFile,         htmlString = generateExpertActHtml(           act = act,           images = images         ),         onPdfGenerationFailed = { exception ->           continuation.resume(Result.failure(exception))         },         onPdfGenerated = {           continuation.resume(Result.success(Unit))         }       )     }   } }<\/code><\/pre>\n<p><a href=\"https:\/\/gist.github.com\/stakancheck\/d5039ea7f24e86387fd4bd8f29584dff\" rel=\"noopener noreferrer nofollow\">\u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430 \u043d\u0430 Gist<\/a><\/p>\n<h3>\u041e\u0431\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0432\u0441\u0435 \u0432 Worker<\/h3>\n<p>\u0414\u043b\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0441\u0442\u0430\u043b\u043e \u0432\u0430\u0436\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u0434\u0430\u0447\u0438 \u043f\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0435 \u0438 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u0438\u0441\u044c \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u043b\u0438\u0441\u044c \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u0442\u043e\u0438\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c <code>Worker<\/code>. <\/p>\n<p>\u0412 \u043a\u043e\u0434\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 <code>Repository<\/code> \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0430 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u043c\u0438, \u0447\u0442\u043e\u0431\u044b \u0431\u044b\u043b\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043f\u0440\u043e \u0444\u043e\u043d\u043e\u0432\u0443\u044e \u0440\u0430\u0431\u043e\u0442\u0443 \u043c\u043e\u0436\u043d\u043e <a href=\"https:\/\/developer.android.com\/reference\/androidx\/work\/WorkManager\" rel=\"noopener noreferrer nofollow\">\u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438.<\/a><\/p>\n<p><a href=\"https:\/\/gist.github.com\/stakancheck\/f8dbc666ef97b97bf680e8605e28b587\" rel=\"noopener noreferrer nofollow\">\u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430 \u043d\u0430 Gist<\/a><\/p>\n<h4>\u0420\u0430\u0431\u043e\u0442\u0430 WebView<\/h4>\n<p>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442\u0435 <code>WebView<\/code> (\u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0435\u0434\u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430) \u0438 \u0445\u043e\u0442\u0438\u0442\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e PDF \u0432 \u0444\u043e\u043d\u0435 (<code>Worker<\/code>), \u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e &#171;\u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u044f&#187;. <\/p>\n<p>\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 <code>WebView<\/code> \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0432 \u0431\u043b\u043e\u043a\u0435 <code>Handler(Looper.getMainLooper()).post<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u0434\u0430 \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u043f\u043e\u0442\u043e\u043a\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0412 Android, \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043f\u043e\u0442\u043e\u043a \u0442\u0430\u043a\u0436\u0435 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f UI \u043f\u043e\u0442\u043e\u043a\u043e\u043c. <\/p>\n<h2>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442<\/h2>\n<p>\u042d\u0442\u0443 \u0437\u0430\u0434\u0430\u0447\u0443 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0440\u0435\u0448\u0438\u0442\u044c \u043d\u0435\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u043c \u043c\u0435\u0442\u043e\u0434\u043e\u043c. \u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u043d\u0435\u043b\u044c\u0437\u044f \u043d\u0430\u0437\u0432\u0430\u0442\u044c \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u043e\u0432\u0430\u043d\u043d\u044b\u043c, \u043b\u0443\u0447\u0448\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438. \u041d\u043e \u0435\u0441\u043b\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431, \u0442\u043e, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043c\u043e\u0439 \u043e\u043f\u044b\u0442 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u0435\u043d.<\/p>\n<p>\u0412 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u044d\u0442\u043e\u0442 \u043f\u043e\u0434\u0445\u043e\u0434 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e \u0438 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u043e. \u041e\u0442\u0447\u0435\u0442\u044b \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0442 \u0431\u043e\u043b\u0435\u0435 100 \u0444\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0439, \u0432\u0441\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0431\u0435\u0437 \u043e\u0448\u0438\u0431\u043e\u043a. \u042d\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u043b\u043e \u043d\u0430\u043c \u0431\u044b\u0441\u0442\u0440\u043e \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u0432\u0438\u0434 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043f\u043e\u0434 \u043d\u043e\u0432\u044b\u0439 \u0441\u0442\u0438\u043b\u044c \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0438\u043d\u0444\u043e\u0433\u0440\u0430\u0444\u0438\u043a\u0443 Plotly, \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0432 JS. <\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/809141\/\"> https:\/\/habr.com\/ru\/articles\/809141\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-374183","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/374183","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=374183"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/374183\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=374183"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=374183"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=374183"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}