{"id":214967,"date":"2014-03-07T11:22:02","date_gmt":"2014-03-07T07:22:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=214967"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=214967","title":{"rendered":"<span class=\"post_title\">\u041f\u043e\u043b\u0435\u0437\u043d\u044b\u0439 Open Source \u0438 \u043a\u0430\u043a \u043c\u044b \u043d\u0430\u0443\u0447\u0438\u043b\u0438 Zxing \u0440\u0430\u0437\u0433\u043e\u0432\u0430\u0440\u0438\u0432\u0430\u0442\u044c \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u043c \u044f\u0437\u044b\u043a\u0435<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t\u0412 <a href=\"http:\/\/habrahabr.ru\/company\/eastbanctech\/blog\/211669\/\">\u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u043d\u0430\u0448\u0438\u0445 \u0441\u0442\u0430\u0442\u0435\u0439<\/a> \u043c\u044b \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u043b\u0438 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432\u0445\u043e\u0434\u044f\u0449\u0435\u0439 \u043f\u043e\u0447\u0442\u044b \u0432 SharePoint 2010 \u0434\u043b\u044f \u043f\u0440\u0438\u0435\u043c\u0430 \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0445 \u043e\u0442\u0441\u043a\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0442\u0430\u043b\u043e\u043d\u044b. \u041f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043d\u0430\u043c \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0440\u0435\u0448\u0438\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447. \u0418 \u0441\u0435\u0439\u0447\u0430\u0441 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c\u0441\u044f \u043d\u0430 \u043e\u0434\u043d\u043e\u043c \u043c\u043e\u043c\u0435\u043d\u0442\u0435. <\/p>\n<p>  <a name=\"habracut\"><\/a><img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/fdd\/6a5\/39b\/fdd6a539b1d88bd7bd6368e5ea501c29.png\"\/><\/p>\n<p>  \u0418\u0442\u0430\u043a, \u043e\u0434\u043d\u0430 \u0438\u0437 \u0437\u0430\u0434\u0430\u0447 \u0441\u0432\u043e\u0434\u0438\u043b\u0430\u0441\u044c \u043a \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044e \u043d\u043e\u043c\u0435\u0440\u043e\u0432 \u043d\u0430 \u043b\u0438\u0441\u0442\u0435 \u0441\u043a\u0430\u043d\u0430 \u0442\u0430\u043b\u043e\u043d\u043e\u0432. \u0421\u0442\u043e\u0438\u0442 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0442\u0430\u043b\u043e\u043d\u043e\u0432 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e, \u0438 \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043b\u0438\u0441\u0442\u0435 \u043e\u043d\u0438 \u043c\u043e\u0433\u0443\u0442 \u043a\u0430\u043a \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u043e, \u0442\u0430\u043a \u0438 \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u043e. <\/p>\n<p>  \u0422\u043e, \u0447\u0442\u043e \u043c\u044b \u0443\u0432\u0438\u0434\u0435\u043b\u0438 \u043d\u0430 \u0441\u043a\u0430\u043d\u0430\u0445 \u0442\u0430\u043b\u043e\u043d\u043e\u0432, \u0441\u0438\u043b\u044c\u043d\u043e \u043d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u043b\u043e \u0448\u0442\u0440\u0438\u0445-\u043a\u043e\u0434 <a href=\"http:\/\/en.wikipedia.org\/wiki\/Codabar\">Codabar<\/a>, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043d\u0430\u043c \u0443\u0436\u0435 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445. <\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/041\/34c\/870\/04134c8704e4207f42e5c677005315f8.png\"\/><\/p>\n<p>  <i>Codabar \u2013 \u044d\u0442\u043e \u043b\u0438\u043d\u0435\u0439\u043d\u044b\u0439 \u0448\u0442\u0440\u0438\u0445-\u043a\u043e\u0434. \u041a\u0430\u0436\u0434\u044b\u0439 \u0441\u0438\u043c\u0432\u043e\u043b \u043a\u043e\u0434\u0438\u0440\u0443\u0435\u0442\u0441\u044f 7 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c\u0438: 4 \u043b\u0438\u043d\u0438\u044f\u043c\u0438 \u0438 3 \u043f\u0440\u043e\u0431\u0435\u043b\u0430\u043c\u0438 \u043c\u0435\u0436\u0434\u0443 \u043d\u0438\u043c\u0438. \u041c\u0435\u0436\u0434\u0443 \u0441\u043e\u0431\u043e\u0439 \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u044e\u0442\u0441\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e\u043c. \u041d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f Codabar \u0441\u043e \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u043e\u0433\u043e \u0441\u0438\u043c\u0432\u043e\u043b\u0430, \u0438 \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u0442\u043e\u043f\u043e\u0432\u044b\u043c. \u0421\u0442\u0430\u0440\u0442\u043e\u0432\u044b\u043c\u0438 \u0438\u043b\u0438 \u0441\u0442\u043e\u043f\u043e\u0432\u044b\u043c\u0438 \u0441\u0438\u043c\u0432\u043e\u043b\u0430\u043c\u0438 \u0441\u043b\u0443\u0436\u0430\u0442, \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u0441\u0438\u043c\u0432\u043e\u043b\u044b ABCD. \u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0432\u043d\u044b\u043c\u0438: 0-9, -, $.<br \/>  \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0434\u043b\u044f \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0448\u0442\u0440\u0438\u0445-\u043a\u043e\u0434\u0430 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0430\u043b\u0444\u0430\u0432\u0438\u0442, \u0433\u0434\u0435 \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0441\u0438\u043c\u0432\u043e\u043b\u0443 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u0430\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043b\u0438\u043d\u0438\u0439 \u0438 \u043f\u0440\u043e\u0431\u0435\u043b\u043e\u0432.<\/i><\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/364\/ced\/746\/364ced74698dc23e7cff2a588caf119c.jpg\"\/> <br \/>  \u041d\u0430 \u043a\u0430\u0440\u0442\u0438\u043d\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043d \u043f\u0440\u0438\u043c\u0435\u0440 Codabar\u2019a, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u00ab401\u00bb.<\/p>\n<h4>ZXing<\/h4>\n<p>  \u041f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441\u043e \u0448\u0442\u0440\u0438\u0445-\u043a\u043e\u0434\u0430\u043c\u0438 \u0432 .NET \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c <a href=\"http:\/\/zxingnet.codeplex.com\/\">\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 Zxing<\/a>. \u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0443\u043c\u0435\u0435\u0442 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u0442\u044c \u0432\u0441\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 1D \u0438 2D \u0431\u0430\u0440\u043a\u043e\u0434\u044b: QR-Code, PDF 417, EAN, UPC, Aztec, Data Matrix. \u0418 \u0433\u043b\u0430\u0432\u043d\u043e\u0435, \u043e\u043d\u0430 \u0443\u043c\u0435\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 Codabar. \u041f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 Zxing \u043e\u0431\u044b\u0447\u043d\u043e \u043d\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c, \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0435\u0435 \u043d\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430\u0445. \u041d\u043e \u043d\u0430\u0448 \u0448\u0442\u0440\u0438\u0445-\u043a\u043e\u0434 Zxing \u0441\u0445\u043e\u0434\u0443 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0442\u044c \u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c. \u0412\u0441\u0451 \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u043d\u0435 \u0442\u0430\u043a \u043f\u0440\u043e\u0441\u0442\u043e\u2026 \u041f\u0440\u0438 \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u043c \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u0438 \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u043a\u043e\u0434\u044b \u0437\u0430\u043a\u0430\u0437\u0447\u0438\u043a\u0430 \u0445\u043e\u0442\u044c \u0438 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u0445\u043e\u0436\u0438 \u043d\u0430 Codabar, \u043d\u043e \u0432\u0441\u0451 \u0436\u0435 \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e:<\/p>\n<ul>\n<li>\u0438\u043c\u0435\u044e\u0442 \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u044b\u0435 \u0438 \u0441\u0442\u043e\u043f\u043e\u0432\u044b\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b;<\/li>\n<li>\u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u0441\u0438\u043c\u0432\u043e\u043b \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u043d\u0435 \u0438\u0437 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 7 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 (4 \u043b\u0438\u043d\u0438\u0438 \u0438 3 \u043f\u0440\u043e\u0431\u0435\u043b\u0430), \u0430 \u0438\u0437 9 (5 \u043b\u0438\u043d\u0438\u0439, 4 \u043f\u0440\u043e\u0431\u0435\u043b\u0430);<\/li>\n<li>\u0441\u0442\u0430\u0440\u0442\u043e\u0432\u044b\u0439 \u0438 \u0441\u0442\u043e\u043f\u043e\u0432\u044b\u0439 \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u0442\u0430\u043a\u0436\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u0442 \u043d\u0435 \u0438\u0437 7 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u0430 \u0438\u0437 3 (2 \u043b\u0438\u043d\u0438\u0438, 1 \u043f\u0440\u043e\u0431\u0435\u043b).<\/li>\n<\/ul>\n<p>  \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u044d\u0442\u043e\u0442 \u0444\u043e\u0440\u043c\u0430\u0442 \u0442\u043e\u0436\u0435 \u00ab\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0435\u043d\u00bb, \u0445\u043e\u0442\u044f \u043c\u044b \u043d\u0435 \u043d\u0430\u0448\u043b\u0438 \u0435\u0433\u043e \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0438 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u043d\u0451\u043c. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u043a\u043e\u0434\u0430, \u043d\u043e \u043d\u0430\u043c \u043d\u0435 \u043f\u043e\u0441\u0447\u0430\u0441\u0442\u043b\u0438\u0432\u0438\u043b\u043e\u0441\u044c \u0438\u0445 \u043d\u0430\u0439\u0442\u0438\u2026 \u0412 \u0438\u0442\u043e\u0433\u0435, \u0431\u044b\u043b\u043e \u0440\u0435\u0448\u0435\u043d\u043e \u043f\u043e\u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 Zxing, \u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435: \u0432\u0437\u044f\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 \u043a\u043e\u0434\u0430 \u0438 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u0434 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u043d\u0443\u0436\u0434\u044b. <\/p>\n<h4>\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c<\/h4>\n<p>  \u0412 Zxing \u0443 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430, \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0449\u0435\u0433\u043e \u043b\u043e\u0433\u0438\u043a\u0443 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, CodabarReader.cs), \u0435\u0441\u0442\u044c \u0441\u0432\u043e\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 decodeRow, \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0432 \u043a\u043b\u0430\u0441\u0441\u0435 OneDReader.cs. <\/p>\n<pre><code class=\"cs\">override public List&lt;Result&gt; decodeRow(int rowNumber, BitArray row, Hashtable hints) <\/code><\/pre>\n<p>  \u041d\u0430 \u0432\u0445\u043e\u0434 \u043f\u043e\u0434\u0430\u0451\u0442\u0441\u044f \u043d\u043e\u043c\u0435\u0440 \u0441\u0442\u0440\u043e\u043a\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0438 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043c\u0430\u0441\u0441\u0438\u0432, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0438\u043a\u0441\u0435\u043b\u0435\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 (\u0442\u0451\u043c\u043d\u044b\u0439 \u2014 \u0441\u0432\u0435\u0442\u043b\u044b\u0439).<\/p>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043c\u0435\u0442\u043e\u0434\u0430 setCounters(BitArray row) \u0438\u043d\u0438\u0446\u0438\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043c\u0430\u0441\u0441\u0438\u0432 int[] counters \u043f\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0443: \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u0442\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u0438\u043a\u0441\u0435\u043b\u044f \u043f\u0435\u0440\u0432\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f, \u043f\u043e\u043a\u0430 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435 row \u043d\u0435 \u0432\u0441\u0442\u0440\u0435\u0442\u0438\u0442\u0441\u044f \u0431\u0435\u043b\u044b\u0439 \u043f\u0438\u043a\u0441\u0435\u043b\u044c. \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u043a\u043e \u0432\u0442\u043e\u0440\u043e\u043c\u0443 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0443 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 counters, \u0438 \u043e\u043d \u0442\u043e\u0436\u0435 \u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f, \u043f\u043e\u043a\u0430 \u043d\u0435 \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u0447\u0435\u0440\u043d\u044b\u0439 \u043f\u0438\u043a\u0441\u0435\u043b\u044c. \u0418 \u0442\u0430\u043a \u0434\u043e \u043a\u043e\u043d\u0446\u0430 \u0441\u0442\u0440\u043e\u043a\u0438. \u0412 \u0438\u0442\u043e\u0433\u0435 \u043c\u0430\u0441\u0441\u0438\u0432 counters \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0432\u0438\u0434:<\/p>\n<p>  15 7 10 3 4 8 16\u2026<\/p>\n<p>  \u0442.\u0435.: 15 \u0447\u0451\u0440\u043d\u044b\u0445 \u043f\u0438\u043a\u0441\u0435\u043b\u0435\u0439, 7 \u0431\u0435\u043b\u044b\u0445, 10 \u0447\u0451\u0440\u043d\u044b\u0445, 3 \u0431\u0435\u043b\u044b\u0445 \u0438 \u0442.\u0434. (\u043f\u0435\u0440\u0432\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0447\u0435\u0440\u043d\u044b\u043c \u043f\u0438\u043a\u0441\u0435\u043b\u044f\u043c).<\/p>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u0438\u0449\u0435\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u043e\u043c\u0443 \u0441\u0438\u043c\u0432\u043e\u043b\u0443 (\u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e \u0441\u0438\u043c\u0432\u043e\u043b \u00ab\u0410\u00bb, \u0432 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u043c Codabar \u2013 \u043e\u0434\u0438\u043d \u0438\u0437 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u00abA\u00bb, \u00abB\u00bb, \u00abC\u00bb \u0438\u043b\u0438 \u00abD\u00bb). \u0418\u0449\u0435\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0442\u043e\u0434\u0430 findStartPattern(out int charOffset, int globalOffset). \u041f\u043e\u043a\u0430 \u043d\u0435\u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u0430, \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 globalOffset (\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432 \u0441\u0442\u0440\u043e\u043a\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f) \u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443 \u0441\u0438\u043c\u0432\u043e\u043b\u0443 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 counters. \u0412 \u043c\u0435\u0442\u043e\u0434\u0435 findStartPattern \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043c\u0435\u0442\u043e\u0434:<\/p>\n<pre><code class=\"cs\">int toNarrowWidePattern(int position, int offset) <\/code><\/pre>\n<p>  \u041e\u043d \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043d\u043e\u043c\u0435\u0440 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 counters \u0438 \u0434\u043b\u0438\u043d\u0443 \u0441\u0438\u043c\u0432\u043e\u043b\u0430 (3 \u2013 \u0434\u043b\u044f \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u043e\u0433\u043e \u0438\u043b\u0438 \u0441\u0442\u043e\u043f\u043e\u0432\u043e\u0433\u043e \u0441\u0438\u043c\u0432\u043e\u043b\u0430; 9 \u2013 \u0434\u043b\u044f \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432). \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 -1 \u0435\u0441\u043b\u0438 \u0441\u0438\u043c\u0432\u043e\u043b \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d. \u0415\u0441\u043b\u0438 \u0441\u0438\u043c\u0432\u043e\u043b \u043d\u0430\u0439\u0434\u0435\u043d \u2013 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u044d\u0442\u0443 \u043f\u043e\u0437\u0438\u0446\u0438\u044e \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435 CHARACTER_ENCODINGS.<\/p>\n<h4>\u0410\u043b\u0444\u0430\u0432\u0438\u0442<\/h4>\n<p>  \u0410\u043b\u0444\u0430\u0432\u0438\u0442 \u043a\u043e\u0434\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c\u0438 \u043f\u043e\u043b\u044f\u043c\u0438:  <\/p>\n<ul>\n<li>char[] ALPHABET_STRING \u2013 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432\u0441\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u0432 \u043a\u043e\u0434\u0435.<\/li>\n<li>int[] CHARACTER_ENCODINGS \u2013 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0446\u0438\u0444\u0440\u0443, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0449\u0443\u044e \u043a\u043e\u0434\u043e\u0432\u0443\u044e \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c, \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u043d\u0443\u044e \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0441\u0438\u043c\u0432\u043e\u043b\u0430 \u043a\u043e\u0434\u0430.<\/li>\n<\/ul>\n<p>  \u041d\u0435\u043c\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u0432 \u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u0445, \u0445\u0440\u0430\u043d\u044f\u0449\u0438\u0445\u0441\u044f \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435 CHARACTER_ENCODINGS \u0438 \u0432\u043e\u043e\u0431\u0449\u0435 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u043a\u043e\u0434\u0438\u0440\u0443\u0435\u0442\u0441\u044f Codabar. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0446\u0438\u0444\u0440\u0430 \u00ab0\u00bb \u043a\u043e\u0434\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u043e\u043b\u043e\u0441\u043e\u043a \u0438 \u043f\u0440\u043e\u0431\u0435\u043b\u043e\u0432:<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/e58\/676\/017\/e5867601780072fe2dcef451d90a42aa.png\"\/> <\/p>\n<p>  \u0417\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u044d\u0442\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c: 101010011 (barcode encoding). \u041e\u0434\u0438\u043d\u043e\u0447\u043d\u044b\u0439 0\/1 \u043a\u043e\u0434\u0438\u0440\u0443\u0435\u0442 \u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0439 \u043f\u0440\u043e\u0431\u0435\u043b\/\u043f\u043e\u043b\u043e\u0441\u0443, \u0441\u0434\u0432\u043e\u0435\u043d\u043d\u044b\u0439 00\/11 \u043a\u043e\u0434\u0438\u0440\u0443\u0435\u0442 \u0434\u043b\u0438\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u0431\u0435\u043b\/\u043f\u043e\u043b\u043e\u0441\u0443. \u0414\u0430\u043b\u0435\u0435 \u044d\u0442\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u043a\u043e\u0434 0000011 (width encoding), \u0438\u043b\u0438 \u0432 \u0448\u0435\u0441\u0442\u043d\u0430\u0434\u0446\u0430\u0442\u0435\u0440\u0438\u0447\u043d\u043e\u043c \u0432\u0438\u0434\u0435: 0\u044503. \u0422.\u0435. \u043e\u0434\u0438\u043d\u043e\u0447\u043d\u044b\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043d\u0443\u043b\u0451\u043c, \u0441\u0434\u0432\u043e\u0435\u043d\u043d\u044b\u0435 \u2013 \u0435\u0434\u0438\u043d\u0438\u0446\u0435\u0439. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u0430\u0436\u0434\u044b\u0439 \u0441\u0438\u043c\u0432\u043e\u043b \u043a\u043e\u0434\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043d\u0435 7, \u0430 9 \u0441\u0438\u043c\u0432\u043e\u043b\u0430\u043c\u0438, \u043d\u043e \u043b\u043e\u0433\u0438\u043a\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0446\u0438\u0444\u0440\u043e\u0432\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0442\u0430 \u0436\u0435.<\/p>\n<p>  \u041d\u0430\u043c \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043f\u043e\u0442\u0440\u0430\u0442\u0438\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043d\u0430 \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0442\u0430\u043b\u043e\u043d\u043e\u0432. \u041c\u044b \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u0433\u043b\u044f\u0434\u044b\u0432\u0430\u043b\u0438\u0441\u044c \u0432 \u0448\u0442\u0440\u0438\u0445-\u043a\u043e\u0434\u044b \u0438 \u0432\u044b\u043f\u0438\u0441\u044b\u0432\u0430\u043b\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u0442\u043e\u043c\u0443 \u0438\u043b\u0438 \u0438\u043d\u043e\u043c\u0443 \u0441\u0438\u043c\u0432\u043e\u043b\u0443. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f \u043d\u0430\u0448 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0430\u043b\u0444\u0430\u0432\u0438\u0442:<\/p>\n<pre><code class=\"cs\">private const String ALPHABET_STRING = &quot;0123456789AE&quot;; static int[] CHARACTER_ENCODINGS = {                          0x014, 0x101, 0x041, 0x140, 0x011, 0x110, 0x050, 0x005, 0x104, 0x044, \/\/ 0-9                          0x000, 0x004, \/\/ AE}; <\/code><\/pre>\n<p>  \u0418\u0442\u0430\u043a, \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043a\u043e\u0434\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c: \u043a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0445\u043e\u0434\u0438\u043c \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u044b\u0439 \u0441\u0438\u043c\u0432\u043e\u043b \u2013 \u0438\u0449\u0435\u043c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0432\u0441\u0451 \u0442\u043e\u0442 \u0436\u0435 \u043c\u0435\u0442\u043e\u0434 toNarrowWidePattern. \u0414\u043b\u0438\u043d\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f, \u0442.\u0435. \u043d\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u043c \u0448\u0430\u0433\u0435 \u043d\u0430\u043c \u043d\u0430\u0434\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u0438 \u0441\u0438\u043c\u0432\u043e\u043b \u0441\u0442\u043e\u043f\u043e\u0432\u044b\u043c. \u0415\u0441\u043b\u0438 \u0434\u0430 \u2013 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0443 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 counters, \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u044f \u043f\u043e\u0438\u0441\u043a \u0448\u0442\u0440\u0438\u0445-\u043a\u043e\u0434\u043e\u0432 \u0432 \u0441\u0442\u0440\u043e\u043a\u0435.<\/p>\n<p>  \u0412 \u0438\u0442\u043e\u0433\u0435, \u043f\u0440\u043e\u0441\u043a\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u0432 \u0441\u0442\u0440\u043e\u043a\u0443, \u0438\u043c\u0435\u0435\u043c (\u0438\u043b\u0438 \u043d\u0435 \u0438\u043c\u0435\u0435\u043c) \u043e\u0434\u0438\u043d \u0438 \u0431\u043e\u043b\u0435\u0435 \u043a\u043e\u0434\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0432 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432. \u0418 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f.<\/p>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u0431\u044b\u043b\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u043f\u043e\u0432\u043e\u0440\u043e\u0442 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043f\u043e \u0447\u0430\u0441\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u0435\u043b\u043a\u0435 \u043d\u0430 90 \u0433\u0440\u0430\u0434\u0443\u0441\u043e\u0432, \u0435\u0441\u043b\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442 \u043d\u0430 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043a\u043e\u0434\u043e\u0432 \u0432\u043e \u0432\u0441\u0435\u0445 \u0447\u0435\u0442\u044b\u0440\u0451\u0445 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445. \u0412 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 Zxing \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c, \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u0432 \u043a\u043b\u0430\u0441\u0441\u0435 BinaryBitmap, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u043c\u0435\u0435\u0442 \u043c\u0435\u0442\u043e\u0434 rotateCounterClockwise(). \u041f\u043e\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043d\u0435 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0442\u0440\u0443\u0434\u0430.<\/p>\n<p>  \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u0443\u043c\u0430\u0432 \u0438 \u043f\u043e\u0442\u0440\u0443\u0434\u0438\u0432\u0448\u0438\u0441\u044c, \u043c\u044b \u0441\u043c\u043e\u0433\u043b\u0438 \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u043f\u043e\u0434 \u043d\u043e\u0432\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 \u043a\u043e\u0434\u0430. \u041a\u043e\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u043a\u043e\u0434 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0442\u0443\u0442 <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0421\u043a\u0440\u044b\u0442\u044b\u0439 \u0442\u0435\u043a\u0441\u0442<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cs\">using System; using System.Collections; using System.Collections.Generic; using System.Text; using BitArray = ETR.REBT.BarcodeReader.common.BitArray;  namespace ETR.REBT.BarcodeReader.oned {         public sealed class MyCodeReader : OneDReader     {         \/\/ These values are critical for determining how permissive the decoding         \/\/ will be. All stripe sizes must be within the window these define, as         \/\/ compared to the average stripe size.         private static readonly int MAX_ACCEPTABLE = (int)(PATTERN_MATCH_RESULT_SCALE_FACTOR * 2.0f);         private static readonly int PADDING = (int)(PATTERN_MATCH_RESULT_SCALE_FACTOR * 1.5f);          private static readonly int STARTEND_LENGTH = 3;         private static readonly int SYMBOL_LENGTH = 9;         private static readonly int DATA_LENGTH = 15; \/\/ 15 symbols + 2 start\/stop symbols         private static readonly int All_LENGHT = (16 + DATA_LENGTH * SYMBOL_LENGTH + 2 * STARTEND_LENGTH);          private const String ALPHABET_STRING = &quot;0123456789AE&quot;;         internal static readonly char[] ALPHABET = ALPHABET_STRING.ToCharArray();          \/**          * These represent the encodings of characters, as patterns of wide and narrow bars. The 7 least-significant bits of          * each int correspond to the pattern of wide and narrow, with 1s representing &quot;wide&quot; and 0s representing narrow.          *\/          internal static int[] CHARACTER_ENCODINGS = {                                                     0x014, 0x101, 0x041, 0x140, 0x011, 0x110, 0x050, 0x005, 0x104, 0x044, \/\/ 0-9                                                     0x000, 0x004, \/\/ AE                                                  };          \/\/ minimal number of characters that should be present (inclusing start and stop characters)         \/\/ under normal circumstances this should be set to 3, but can be set higher         \/\/ as a last-ditch attempt to reduce false positives.         private const int MIN_CHARACTER_LENGTH = 3;          \/\/ Start and end patterns                 private static readonly char[] START_ENCODING = { 'A' };          private static readonly char[] END_ENCODING = { 'E' };          private static readonly char[] DATA_ENCODING = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' };          \/\/ some codabar generator allow the codabar string to be closed by every         \/\/ character. This will cause lots of false positives!          \/\/ some industries use a checksum standard but this is not part of the original codabar standard         \/\/ for more information see : http:\/\/www.mecsw.com\/specs\/codabar.html          \/\/ Keep some instance variables to avoid reallocations         private readonly StringBuilder decodeRowResult;         private int[] counters;         private int counterLength;          public MyCodeReader()         {             decodeRowResult = new StringBuilder(40);             counters = new int[500];             counterLength = 0;         }          override public List&lt;Result&gt; decodeRow(int rowNumber, BitArray row, Hashtable hints)         {                                     List&lt;Result&gt; returnList = null;                          if (!setCounters(row))                 return null;              int globalOffset = 0;              while (globalOffset &lt; counterLength)             {                 int startSymbolPos = -1;                 int startOffset = findStartPattern(out startSymbolPos, globalOffset);                 if (startOffset &lt; 0)                     return returnList; \/\/ we can't find start char in the whole row -&gt; so, exit                  decodeRowResult.Length = 0;                  decodeRowResult.Append((char)startSymbolPos);                                  int nextStart = startOffset;                 nextStart += (STARTEND_LENGTH + 1\/*space between symbols*\/);                  bool findNextStart = false;                  do                 {                     int charOffset = toNarrowWidePattern(nextStart, SYMBOL_LENGTH);                     if (charOffset == -1 || !arrayContains(DATA_ENCODING, ALPHABET[charOffset]))                     {                         findNextStart = true;                         break;                     }                      decodeRowResult.Append((char)charOffset);                                          nextStart += (SYMBOL_LENGTH + 1);                      \/\/  Stop as soon as length of data symbols equals to corresponding number                     if (decodeRowResult.Length == DATA_LENGTH + 1\/*start symbol*\/)                     {                         int endOffset = toNarrowWidePattern(nextStart, STARTEND_LENGTH);                         if (endOffset == -1 || !arrayContains(END_ENCODING, ALPHABET[endOffset]))                         {                             findNextStart = true;                             break;                         }                          globalOffset = nextStart + STARTEND_LENGTH;                          decodeRowResult.Append((char)endOffset);                         break;                     }                  } while (nextStart &lt; counterLength); \/\/ no fixed end pattern so keep on reading while data is available                                          if (findNextStart)                 {                     globalOffset = ++startOffset;                                         continue;                 }                  if (!validatePattern())                 {                     globalOffset = ++startOffset;                     continue;                 }                  \/\/ remove stop\/start characters character                             decodeRowResult.Remove(decodeRowResult.Length - 1, 1);                 decodeRowResult.Remove(0, 1);                  int runningCount = 0;                 for (int i = 0; i &lt; startOffset; i++)                 {                     runningCount += counters[i];                 }                 float left = (float)runningCount;                 for (int i = startOffset; i &lt; nextStart - 1; i++)                 {                     runningCount += counters[i];                 }                 float right = (float)runningCount;                 Result result = new Result(                     decodeRowResult.ToString(),                     null,                     new ResultPoint[]             {                 new ResultPoint(left, (float) rowNumber),                 new ResultPoint(right, (float) rowNumber)             },                     BarcodeFormat.CODABAR);                  if (returnList == null)                     returnList = new List&lt;Result&gt;();                  returnList.Add(result);             }                          return returnList;         }          private bool validatePattern()         {             if (decodeRowResult.Length != DATA_LENGTH + 2)             {                 return false;             }              \/\/ Translate character table offsets to actual characters.             for (int i = 0; i &lt; decodeRowResult.Length; i++)             {                 decodeRowResult[i] = ALPHABET[decodeRowResult[i]];             }              \/\/ Ensure a valid start character             char startchar = decodeRowResult[0];             if (!arrayContains(START_ENCODING, startchar))             {                 return false;             }             \/\/ Ensure a valid end character             char endchar = decodeRowResult[decodeRowResult.Length - 1];             if (!arrayContains(END_ENCODING, endchar))             {                 return false;             }              \/\/ Ensure a valid data symbols             for (int i = 1; i &lt; decodeRowResult.Length - 1; i++)             {                 if (!arrayContains(DATA_ENCODING, decodeRowResult[i]))                 {                     return false;                 }             }              return true;         }          \/\/\/ &lt;summary&gt;         \/\/\/ Records the size of all runs of white and black pixels, starting with white.         \/\/\/ This is just like recordPattern, except it records all the counters, and         \/\/\/ uses our builtin &quot;counters&quot; member for storage.         \/\/\/ &lt;\/summary&gt;         \/\/\/ &lt;param name=&quot;row&quot;&gt;row to count from&lt;\/param&gt;         private bool setCounters(BitArray row)         {                                     counterLength = 0;             \/\/ Start from the first white bit.             int i = row.getNextUnset(0);             int end = row.Size;             if (i &gt;= end)             {                 return false;             }             bool isWhite = true;             int count = 0;             for (; i &lt; end; i++)             {                 if (row[i] ^ isWhite)                 {                     \/\/ that is, exactly one is true                     count++;                 }                 else                 {                     counterAppend(count);                     count = 1;                     isWhite = !isWhite;                 }             }             counterAppend(count);                         return true;         }          private void counterAppend(int e)         {             counters[counterLength] = e;             counterLength++;             if (counterLength &gt;= counters.Length)             {                 int[] temp = new int[counterLength * 2];                 Array.Copy(counters, 0, temp, 0, counterLength);                 counters = temp;             }         }          private int findStartPattern(out int charOffset, int globalOffset)         {             charOffset = -1;              \/\/             \/\/ Assume that first (i = 0) set of pixels is white,             \/\/ so we start find symbols from second set (i = 1).             \/\/ And next we step over white set ('i += 2').             \/\/             for (int i = 1 + globalOffset; i &lt; counterLength; i += 2)             {                 if (counters[i - 1] &lt; counters[i] * 5) \/\/ before start char must be a long space                     continue;                                                  charOffset = toNarrowWidePattern(i, 3);                 if (charOffset != -1 && arrayContains(START_ENCODING, ALPHABET[charOffset]))                 {                                                                                 return i;                 }             }             return -1;         }          internal static bool arrayContains(char[] array, char key)         {             if (array != null)             {                 foreach (char c in array)                 {                     if (c == key)                     {                         return true;                     }                 }             }             return false;         }          \/\/ Assumes that counters[position] is a bar.         private int toNarrowWidePattern(int position, int offset)         {             int end = position + offset;             if (end &gt;= counterLength)                                             return -1;                          \/\/ First element is for bars, second is for spaces.                                     int[] maxes = { 0, 0 };             int[] mins = { Int32.MaxValue, Int32.MaxValue };             int[] thresholds = { 0, 0 };              for (int i = 0; i &lt; 2; i++)             {                 for (int j = position + i; j &lt; end; j += 2)                 {                     if (counters[j] &lt; mins[i])                     {                         mins[i] = counters[j];                     }                     if (counters[j] &gt; maxes[i])                     {                         maxes[i] = counters[j];                     }                 }                  double tr = ((double)mins[i] + (double)maxes[i]) \/ 2;                 thresholds[i] = (int)Math.Ceiling(tr);                             }                          \/\/ There are no big spaces in the barcode -&gt; only small spaces             thresholds[1] = Int32.MaxValue;              \/\/ For start and end symbols defined empirically threshold equals to 5             if (offset == STARTEND_LENGTH)                 thresholds[0] = 5;                          int bitmask = 1 &lt;&lt; offset;             int pattern = 0;             for (int i = 0; i &lt; offset; i++)             {                 int barOrSpace = i & 1;                 bitmask &gt;&gt;= 1;                 if (counters[position + i] &gt;= thresholds[barOrSpace])                 {                     pattern |= bitmask;                 }             }              for (int i = 0; i &lt; CHARACTER_ENCODINGS.Length; i++)             {                 if (CHARACTER_ENCODINGS[i] == pattern)                 {                     return i;                 }             }             return -1;         }     } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<h4>\u00ab\u041e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f\u00bb Zxing<\/h4>\n<p>  \u0418\u0442\u0430\u043a, \u0443 \u043d\u0430\u0441 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u0442\u044c \u043e\u0434\u0438\u043d \u0438\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u0434\u043e\u0432 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435. \u041d\u043e \u043d\u0430 \u044d\u0442\u043e\u043c \u043d\u0430\u0448\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043d\u0435 \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u0438\u0441\u044c. \u0422\u0430\u043a \u043a\u0430\u043a \u043f\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c \u0443 \u043d\u0430\u0441 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u0434\u043e\u0432 \u043f\u043b\u044e\u0441 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043a\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c 4 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043b\u0438\u0441\u0442\u0430, \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0441\u0442\u0430\u043b \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u00ab\u0442\u043e\u0440\u043c\u043e\u0437\u0438\u0442\u044c\u00bb. \u041f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043f\u043e\u043a\u043e\u043f\u0430\u0442\u044c\u0441\u044f \u0435\u0449\u0451, \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0447\u0435\u0433\u043e \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b\u0430\u0441\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c:<br \/>  Zxing \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043a\u043b\u0430\u0441\u0441\u0430 RGBLuminanceSource. \u0412 \u043d\u0451\u043c \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u043c\u0430\u0441\u0441\u0438\u0432 \u0431\u0430\u0439\u0442, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u044f\u0440\u043a\u043e\u0441\u0442\u0438 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u0438\u043a\u0441\u0435\u043b\u0430 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f. \u0417\u0430\u0442\u0435\u043c, \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u0438 \u044d\u0442\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0438 \u043f\u043e\u0440\u043e\u0433\u043e\u0432\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0431\u0438\u0442\u043e\u0432\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432.<\/p>\n<p>  \u0412\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u0447\u0430\u0441\u0442\u0438 \u043a\u043e\u0434\u0430 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430 \u043a\u043b\u0430\u0441\u0441\u0430 RGBLuminanceSource:<\/p>\n<pre><code class=\"cs\">   Color c;             for (int y = 0; y &lt; height; y++)             {                 int offset = y * width;                 for (int x = 0; x &lt; width; x++)                 {                     c = bitmap.GetPixel(x, y);                      var r = ColorUtility.GetRValue(c);                     var g = ColorUtility.GetGValue(c);                     var b = ColorUtility.GetBValue(c);                      luminances[offset + x] = (byte)(0.3 * r + 0.59 * g + 0.11 * b + 0.01);                 }             }  <\/code><\/pre>\n<p>  \u0422\u043e \u0435\u0441\u0442\u044c \u0432 \u0446\u0438\u043a\u043b\u0430\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0430\u044f bitmap.GetPixel(x, y) \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u0438\u043a\u0441\u0435\u043b\u044f \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f! \u0414\u043b\u044f \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0441 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c 200\u0445300 \u043f\u0438\u043a\u0441\u0435\u043b\u0435\u0439 (\u0438\u043b\u0438 \u0431\u043b\u0438\u0437\u043a\u0438\u0445 \u043a \u0442\u043e\u043c\u0443) \u0442\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0432\u043f\u043e\u043b\u043d\u0435 \u0443\u043c\u0435\u0441\u0442\u0435\u043d \u0438 \u043d\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0437\u0430\u0434\u0435\u0440\u0436\u0435\u043a (\u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044f, \u0447\u0442\u043e \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0451\u0442\u0441\u044f \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u043a\u043e\u0434). \u041d\u043e \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0438\u043c\u0435\u0435\u0442 \u0432\u044b\u0441\u043e\u043a\u043e\u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435 (\u0434\u043e 3000 \u0445 5000 \u043f\u0438\u043a\u0441\u0435\u043b\u0435\u0439), \u0447\u0442\u043e \u0435\u0449\u0435 \u0438 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0443\u043c\u043d\u043e\u0436\u0438\u0442\u044c \u043d\u0430 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u043e\u0440\u0438\u0435\u043d\u0442\u0430\u0446\u0438\u0438, \u0438 \u0443\u043c\u043d\u043e\u0436\u0438\u0442\u044c \u043d\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446. \u0412\u0441\u0435 \u044d\u0442\u043e \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u043d\u0435\u043f\u0440\u0438\u0435\u043c\u043b\u0435\u043c\u044b\u043c \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0430\u043c. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0432\u044b\u0448\u0435\u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u043a\u0442 \u043a\u043b\u0430\u0441\u0441\u0430 RGBLuminanceSource \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u043b\u0441\u044f \u0441\u0435\u043a\u0443\u043d\u0434 \u0437\u0430 8. \u042d\u0442\u043e, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u043e\u0447\u0435\u043d\u044c \u0434\u043e\u043b\u0433\u043e.<\/p>\n<p>  \u041f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u043a\u043e\u0434, \u0437\u0430\u0431\u044b\u0442\u044c \u043f\u0440\u043e GetPixel \u0438 \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0443 \u043f\u043e \u0441\u043a\u0430\u043d\u043b\u0438\u043d\u0438\u044f\u043c.<\/p>\n<pre><code class=\"cs\"> bmp = bitmap.LockBits(new Rectangle(0, 0, width, height), ImageLockMode.ReadOnly, bitmap.PixelFormat);                 for (var y = 0; y &lt; bmp.Height; y++)                 {                     var row = (byte*)bmp.Scan0 + (y * bmp.Stride);                     int offset = y * width;                     for (var x = 0; x &lt; bmp.Width; x++)                     {                         var b = row[(x * pixelSize)];                         var g = row[(x * pixelSize) + 1];                         var r = row[(x * pixelSize) + 2];                                                  luminances[offset + x] = (byte)(0.3 * r + 0.59 * g + 0.11 * b + 0.01);                     }                 }  <\/code><\/pre>\n<p>  \u042d\u0442\u043e\u0442 \u0448\u0430\u0433 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u0441\u043a\u043e\u0440\u0438\u043b \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u043b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u0440\u0438\u0435\u043c\u043b\u0435\u043c\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438.<\/p>\n<h4>\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 PDF<\/h4>\n<p>  \u041a\u0430\u043a \u0443\u0436\u0435 \u0431\u044b\u043b\u043e \u0441\u043a\u0430\u0437\u0430\u043d\u043e \u0432\u044b\u0448\u0435, \u0441\u043a\u0430\u043d\u044b \u043a\u0443\u043f\u043e\u043d\u043e\u0432 \u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u0441\u0442\u0443\u043f\u0430\u0442\u044c \u043a\u0430\u043a \u0432 \u0432\u0438\u0434\u0435 \u0444\u0430\u0439\u043b\u043e\u0432 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439, \u0442\u0430\u043a \u0438 \u0432 PDF \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0435. \u0414\u043b\u044f \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446 pdf \u0432 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043c\u044b \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438\u0441\u044c <a href=\"http:\/\/itextpdf.com\/\">\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 itextsharp<\/a>. <\/p>\n<p>  \u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043a\u043b\u0430\u0441\u0441 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u044d\u0442\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 \u2014 PdfReader. \u042d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<p>  \u041a\u0443\u0441\u043e\u0447\u043a\u0438 \u043a\u043e\u0434\u0430 \u0438\u0449\u0438\u0442\u0435 \u043f\u043e\u0434 \u0441\u043f\u043e\u0439\u043b\u0435\u0440\u043e\u043c.   <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0421\u043a\u0440\u044b\u0442\u044b\u0439 \u0442\u0435\u043a\u0441\u0442<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cs\">var reader = new PdfReader(filePath) <\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0432 \u043a\u043e\u0434\u0435:  <\/p>\n<pre><code class=\"cs\">for (var pageNumber = 1; pageNumber &lt;= reader.NumberOfPages; pageNumber++)             {                 var page = reader.GetPageN(pageNumber);                 List&lt;ImageRenderInfo&gt; images;                 try                 {                     images = FindImageInPDFDictionary(page);                 }                 catch (Exception)                 {                     \/\/ \u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 PDF \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430                         continue;                 }                 finally                 {                     reader.ReleasePage(pageNumber);                 }                                  foreach (var img in images)                 {                     var image = RenderImage(img);                     var result = ImageDecoder.Decode(image, allRotations);                     if (result != null && result.Count &gt; 0)                     {                         \/\/ \u0421\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u043b\u0430\u0441\u044c, \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0441\u043a\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f                     }                 }             } <\/code><\/pre>\n<p>  \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u044d\u0442\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438\u0449\u0435\u043c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 PDF \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430<\/p>\n<pre><code class=\"cs\">private static List&lt;ImageRenderInfo&gt; FindImageInPDFDictionary(PdfDictionary pg)         {             var result = new List&lt;ImageRenderInfo&gt;();              var res = (PdfDictionary)PdfReader.GetPdfObject(pg.Get(PdfName.RESOURCES));             var xobj = (PdfDictionary)PdfReader.GetPdfObject(res.Get(PdfName.XOBJECT));             if (xobj == null) return null;              foreach (var name in xobj.Keys)             {                 var obj = xobj.Get(name);                 if (!obj.IsIndirect()) continue;                 var tg = (PdfDictionary)PdfReader.GetPdfObject(obj);                  var type = (PdfName)PdfReader.GetPdfObject(tg.Get(PdfName.SUBTYPE));                  if (PdfName.IMAGE.Equals(type))                 {                     var width = float.Parse(tg.Get(PdfName.WIDTH).ToString());                     var height = float.Parse(tg.Get(PdfName.HEIGHT).ToString());                     if (width &gt; ImageDecoder.MinimalSideResolution || height &gt;= ImageDecoder.MinimalSideResolution)                     {                         var imgRi = ImageRenderInfo.CreateForXObject(new Matrix(width, height), (PRIndirectReference)obj, tg);                         result.Add(imgRi);                     }                 }                 if (PdfName.FORM.Equals(type))                 {                     result.AddRange(FindImageInPDFDictionary(tg));                 }                 if (PdfName.GROUP.Equals(type))                 {                     result.AddRange(FindImageInPDFDictionary(tg));                 }             }             return result;         }  <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043e\u0431\u044a\u0435\u043a\u0442 \u0442\u0438\u043f\u0430 Bitmap \u0438\u0437 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u043a\u043b\u0430\u0441\u0441\u0430 ImageRenderInfo<\/p>\n<pre><code class=\"cs\">private static Bitmap RenderImage(ImageRenderInfo renderInfo)         {             try             {                 var image = renderInfo.GetImage();                 using (var dotnetImg = image.GetDrawingImage())                 {                     if (dotnetImg != null)                     {                         using (var ms = new MemoryStream())                         {                                                        dotnetImg.Save(ms, ImageFormat.Png);                             return new Bitmap(dotnetImg);                            }                     }                 }             }             catch (Exception)             {              }             return null;         }  <\/code><\/pre>\n<p>  \u0412 \u043c\u0435\u0442\u043e\u0434\u0435 ImageDecoder.Decode \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442\u0441\u044f \u043b\u043e\u0433\u0438\u043a\u0430 \u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u043a\u043e\u0434\u0430 \u0432 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0435.<\/p>\n<p>  \u0422\u0430\u043a \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u0441\u0435\u0439\u0447\u0430\u0441 \u0432 \u043c\u0438\u0440\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0440\u0430\u0437\u043d\u043e\u0432\u0438\u0434\u043d\u043e\u0441\u0442\u0435\u0439 \u0431\u0430\u0440\u043a\u043e\u0434\u043e\u0432. \u0420\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u0435 \u0438 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0430 \u0438\u0437 \u043d\u0438\u0445 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u0445, \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432. \u0422\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435, \u0438\u043d\u043e\u0433\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0442\u043a\u043d\u0443\u0442\u044c\u0441\u044f \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0442\u0438\u043f \u0431\u0430\u0440\u043a\u043e\u0434\u0430, \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0442\u044c \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0445\u043e\u0434\u0443 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f.<\/p>\n<p>  \u0418 \u0442\u043e\u0433\u0434\u0430 \u043c\u0435\u0442\u043e\u0434 \u0442\u0449\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u043d\u0438\u044f \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0445\u043e\u0440\u043e\u0448\u043e \u0441\u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0431\u044b\u0441\u0442\u0440\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442.    \t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/company\/eastbanctech\/blog\/214967\/\"> http:\/\/habrahabr.ru\/company\/eastbanctech\/blog\/214967\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t\u0412 <a href=\"http:\/\/habrahabr.ru\/company\/eastbanctech\/blog\/211669\/\">\u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u043d\u0430\u0448\u0438\u0445 \u0441\u0442\u0430\u0442\u0435\u0439<\/a> \u043c\u044b \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u043b\u0438 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432\u0445\u043e\u0434\u044f\u0449\u0435\u0439 \u043f\u043e\u0447\u0442\u044b \u0432 SharePoint 2010 \u0434\u043b\u044f \u043f\u0440\u0438\u0435\u043c\u0430 \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0445 \u043e\u0442\u0441\u043a\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0442\u0430\u043b\u043e\u043d\u044b. \u041f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043d\u0430\u043c \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0440\u0435\u0448\u0438\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447. \u0418 \u0441\u0435\u0439\u0447\u0430\u0441 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c\u0441\u044f \u043d\u0430 \u043e\u0434\u043d\u043e\u043c \u043c\u043e\u043c\u0435\u043d\u0442\u0435. <\/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-214967","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/214967","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=214967"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/214967\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=214967"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=214967"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=214967"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}