{"id":275048,"date":"2016-02-26T21:57:03","date_gmt":"2016-02-26T18:57:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=275048"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=275048","title":{"rendered":"jsPDF + canvas: \u044d\u043a\u0441\u043f\u043e\u0440\u0442 \u0432 PDF \u043c\u043d\u043e\u0433\u043e\u0441\u0442\u0440\u0430\u043d\u0438\u0447\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043d\u0430 \u0440\u0443\u0441\u0441\u043a\u043e\u043c \u044f\u0437\u044b\u043a\u0435"},"content":{"rendered":"<p>       \u0413\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f PDF\u2026 \u042d\u0442\u0430 \u0442\u0435\u043c\u0430 \u043d\u0435 \u043d\u043e\u0432\u0430, \u043e\u0434\u043d\u0430\u043a\u043e \u043f\u043e\u0440\u043e\u0439 \u043c\u043e\u0436\u043d\u043e \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u0442\u044c\u0441\u044f \u0441 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0442\u043e\u043d\u043a\u043e\u0441\u0442\u044f\u043c\u0438, \u0432 \u0438\u0442\u043e\u0433\u0435 \u0441\u0442\u0430\u0432 \u043d\u0430 \u0442\u0435\u0440\u043d\u0438\u0441\u0442\u044b\u0439 \u043f\u0443\u0442\u044c \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f. \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443, \u043a\u0430\u043a \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043b \u043e\u0434\u0438\u043d \u0442\u0430\u043a\u043e\u0439 \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434.<\/p>\n<p>  \u041c\u043d\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u043b\u043e\u0441\u044c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e \u043e\u0442\u0447\u0435\u0442\u043e\u0432 \u0432 PDF. \u041f\u043e \u0440\u044f\u0434\u0443 \u043f\u0440\u0438\u0447\u0438\u043d \u044f \u0440\u0435\u0448\u0438\u043b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u043a\u043b\u0438\u0435\u043d\u0442\u0430. \u0411\u0435\u0433\u043b\u044b\u0439 \u043f\u043e\u0438\u0441\u043a \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u043b \u043c\u043d\u0435 \u0432\u044b\u0431\u043e\u0440 \u043c\u0435\u0436\u0434\u0443 <a href=\"http:\/\/mrrio.github.io\/jsPDF\/\">jsPDF<\/a> \u0438 <a href=\"http:\/\/pdfmake.org\/playground.html\">pdfmake<\/a>. \u041e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0441\u044f \u043d\u0430 \u043f\u0435\u0440\u0432\u043e\u043c. \u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435\u2026<\/p>\n<p>  <a name=\"habracut\"><\/a><\/p>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0445\u043e\u0447\u0443 \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u0445\u043e\u0442\u044f jsPDF \u0438 \u0432\u0435\u043b\u0438\u043a\u043e\u043b\u0435\u043f\u043d\u0430\u044f \u0448\u0442\u0443\u043a\u0430, \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043c\u0435\u0441\u0442\u0430\u043c\u0438 \u043d\u0435\u0432\u043c\u0435\u043d\u044f\u0435\u043c\u0430\u044f,<br \/>  \u0447\u0442\u043e \u0443 \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430 \u043f\u0441\u0438\u0445\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0435\u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u0440\u0443\u0433\u0430\u0442\u044c\u0441\u044f \u043d\u0435\u0446\u0435\u043d\u0437\u0443\u0440\u043d\u044b\u043c \u043c\u0430\u0442\u043e\u043c. \u0412\u0441\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f Symfony: \u0435\u0435 \u0447\u0438\u0442\u0430\u0435\u0448\u044c, \u0430 \u043f\u043e\u0442\u043e\u043c \u0438\u0434\u0435\u0448\u044c \u0433\u0443\u0433\u043b\u0438\u0442\u044c \u0441 \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u043c \u00ab\u0430 \u043a\u0430\u043a?\u00bb (\u043b\u0438\u0431\u043e \u0438\u0434\u0435\u0448\u044c \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438).<\/p>\n<p>  <b>\u041f\u0435\u0440\u0432\u044b\u0439<\/b> \u043f\u043e\u0434\u0432\u043e\u0434\u043d\u044b\u0439 \u043a\u0430\u043c\u0435\u043d\u044c, \u0431\u0440\u043e\u0448\u0435\u043d\u043d\u044b\u0439 \u0432 \u043c\u043e\u044e \u0441\u0442\u043e\u0440\u043e\u043d\u0443 \u044d\u0442\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439, \u0431\u044b\u043b\u043e \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u0440\u0443\u0441\u0441\u043a\u043e\u0433\u043e \u044f\u0437\u044b\u043a\u0430 (\u0438 <a href=\"https:\/\/toster.ru\/q\/52020\">UTF-8<\/a> \u0432 \u0446\u0435\u043b\u043e\u043c, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c <a href=\"http:\/\/stackoverflow.com\/a\/26020521\/5397119\">\u0432\u044b\u044f\u0441\u043d\u0438\u0442\u044c<\/a>).<\/p>\n<p>  (pdfmake \u043d\u0430\u043f\u0440\u043e\u0442\u0438\u0432 \u2014 \u0443\u043c\u0435\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 UTF-8, \u043e\u0434\u043d\u0430\u043a\u043e \u043e\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u044d\u0442\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u044f \u0432\u0441\u043a\u043e\u0440\u0435 \u043e\u0442\u043a\u0430\u0437\u0430\u043b\u0441\u044f.)<\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u043f\u043e\u0438\u0441\u043a\u0430 \u0438 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432 \u0440\u0435\u0448\u0438\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c canvas \u0434\u043b\u044f \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0438. \u041e\u0434\u043d\u0430\u043a\u043e \u0437\u0434\u0435\u0441\u044c \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b\u0441\u044f <b>\u0432\u0442\u043e\u0440\u043e\u0439<\/b> \u043f\u043e\u0434\u0432\u043e\u0434\u043d\u044b\u0439 \u043a\u0430\u043c\u0435\u043d\u044c: canvas \u0437\u0430\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u044d\u043a\u0440\u0430\u043d \u0438 \u043c\u043e\u044f \u043e\u0433\u0440\u043e\u043c\u043d\u0430\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u043b\u0430\u0441\u044c, \u043a\u0430\u043a \u043d\u0430\u0431\u043e\u0440 \u043f\u0443\u0441\u0442\u044b\u0445 \u043b\u0438\u0441\u0442\u043e\u0432 ( \u0430 \u0447\u0435, \u044d\u043a\u043e\u043d\u043e\u043c\u043d\u043e).<\/p>\n<p>  \u041f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0440\u0430\u0437\u0431\u0438\u0432\u0430\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u043c, \u0437\u0430\u043d\u043e\u0441\u0438\u0442\u044c \u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440, \u0434\u0435\u043b\u0430\u0442\u044c \u0438\u0437 \u043d\u0435\u0433\u043e canvas \u0438 \u043f\u043e \u043d\u043e\u0432\u043e\u0439. \u0412\u043e\u0442, \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0432 \u0438\u0442\u043e\u0433\u0435:  <\/p>\n<pre><code class=\"javascript\">app.factory(&quot;PDF&quot;, function() {          return {         tableToPDF: function() {             var pdf = new jsPDF('p', 'pt', 'a4');              var rows = $(&quot;table&quot;).find(&quot;tr&quot;);             var pdfContainer = $(&quot;.tmp-pdf-container&quot;);              var pdfInternals = pdf.internal;             var pdfPageSize = pdfInternals.pageSize;             var pdfPageWidth = pdfPageSize.width;             var pdfPageHeight = pdfPageSize.height;              var partialSize = 10;             var contentSize = 0;             var marginTop = 20;             var index = 0;              \/\/ \u0441\u043e\u0437\u0434\u0430\u044e \u043d\u043e\u0432\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u043a\u0430\u0436\u0434\u044b\u0435 partialSize \u0441\u0442\u0440\u043e\u043a             var generatePartial = function() {                 var partial = &quot;&quot;;                 rows.each(function(i, row) {                     if (i &gt;= index && i &lt;= partialSize) {                         partial += &quot;&lt;tr&gt;&quot; + $(this).html() + &quot;&lt;\/tr&gt;&quot;;                         index++;                         if (index &gt;= partialSize) {                             partialSize += 10;                             return false;                         }                     }                 });                  return partial;             }              var processCanvases = function() {                 if (index &gt;= rows.length) {                     pdfContainer.html(&quot;&quot;);                     \/\/pdf.output(&quot;datauri&quot;);                     pdf.save(&quot;TEST.pdf&quot;);                     return;                 }                  var partial = generatePartial();                  \/\/ generate table with that rows                 var table = $(document.createElement(&quot;table&quot;));                 table.append(&quot;&lt;tbody&gt;&quot; + partial + &quot;&lt;\/tbody&gt;&quot;);                      \/\/ insert table to temporary div                 pdfContainer.html(&quot;&lt;table class='table table-fixed-width table-condensed'&gt;&quot; + table.html() + &quot;&lt;\/table&gt;&quot;);                 \/\/ hide unnecessary columns                 pdfContainer.find(&quot;.non-printable&quot;).css(&quot;display&quot;, &quot;none&quot;);                  \/\/ generate canvas from that table                 html2canvas(pdfContainer, {background: &quot;white&quot;}).then(function(canvas) {                     \/\/ contentSize \u043f\u043e\u0434\u0431\u0438\u0440\u0430\u043b \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u043e                     \/\/ \u043d\u0430 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 \u04304 \u0443 \u043c\u0435\u043d\u044f \u0443\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e partial,                     \/\/ \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0436\u0434\u0443, \u043f\u043e\u043a\u0430 \u0434\u043e\u0439\u0434\u0435\u0442 \u0434\u043e \u043a\u043e\u043d\u0446\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u0442\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u044e \u043d\u043e\u0432\u0443\u044e                     if (contentSize &lt; 2) {                         contentSize ++;                         pdf.addImage(canvas, &quot;jpeg&quot;, 20, marginTop, pdfPageWidth-40, 0);                         \/\/ \u0444\u043e\u0440\u043c\u0443\u043b\u0443 \u0438 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442 \u043f\u043e\u0434\u043e\u0431\u0440\u0430\u043b \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u043e                         \/\/ \u0443 \u043c\u0435\u043d\u044f 0.01 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u0442\u0443\u0442 0.05, \u043f\u043e\u043a\u0430 \u043d\u0435 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0441\u044f, \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u044d\u0442\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c                         marginTop += canvas.height\/ (canvas.width \/ pdfPageHeight + (pdfPageWidth \/ pdfPageHeight) - 0.05);                     } else {                         pdf.addImage(canvas, &quot;jpeg&quot;, 20, marginTop, pdfPageWidth-40, 0);                         \/\/ \u044d\u0442\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0443\u0436\u043d\u0430, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043b\u0438\u0448\u043d\u044e\u044e \u043f\u0443\u0441\u0442\u0443\u044e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0432 \u043a\u043e\u043d\u0446\u0435                         if (index &lt; rows.length) {                             pdf.addPage();                         }                         contentSize = 0;                         marginTop = 0;                     }                     \/\/ next iteration                     processCanvases();                 });             }              processCanvases();          }     } }); <\/code><\/pre>\n<pre><code class=\"html\">&lt;div class=&quot;tmp-pdf-container&quot; style=&quot;position: absolute; left: -9999; width: 1000px&quot;&gt;&lt;\/div&gt; <\/code><\/pre>\n<p>  \u041e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0445\u043e\u0447\u0443 \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044c \u0444\u043e\u0440\u043c\u0430\u0442 PNG. \u0428\u0442\u0443\u043a\u0430 \u0445\u043e\u0440\u043e\u0448\u0430\u044f (\u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044f \u0437\u043d\u0430\u044e, \u043e\u043d \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u0442\u0430\u0440\u044b\u043c\u0438 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430\u043c\u0438, \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 image\/jpeg), \u043d\u043e PDF \u0443\u0442\u044f\u0436\u0435\u043b\u044f\u0435\u0442 \u0432 \u0440\u0430\u0437\u044b. \u0412\u0434\u043e\u0431\u0430\u0432\u043e\u043a \u043d\u0430 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043e\u0442\u0447\u0435\u0442\u0430\u0445 \u0431\u0440\u0430\u0443\u0437\u0435\u0440 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e \u043b\u044f\u0436\u0435\u0442, \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e \u0443 \u043c\u0435\u043d\u044f \u0445\u0440\u043e\u043c \u0432\u044b\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u043b \u043e\u043a\u043d\u043e \u043e\u0448\u0438\u0431\u043a\u0438, \u0430 \u0424\u0424 \u0432\u043e\u043e\u0431\u0449\u0435 \u0443\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u043b \u0441\u0435\u0431\u044f \u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u0443, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u043f\u0430\u0441\u0430\u043b\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u0443\u0432\u0430\u043b\u0434\u0430.<\/p>\n<p>  \u041a\u043e\u0433\u0434\u0430 \u0441\u0442\u0430\u043b \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 JPEG, \u0443 \u043c\u0435\u043d\u044f \u043f\u043e\u043b\u0443\u0447\u0430\u043b\u0441\u044f <s>\u0430\u0444\u0440\u043e<\/s> \u0447\u0435\u0440\u043d\u044b\u0439 \u0444\u043e\u043d. \u041e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e <a href=\"http:\/\/stackoverflow.com\/questions\/25253015\/flot-renders-png-image-with-a-different-background-color-than-it-does-in-browser\">\u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u043e\u0441\u0442\u044c JPEG \u0434\u0435\u043b\u0430\u0435\u0442 <s>\u0430\u0444\u0440\u043e<\/s> \u0447\u0435\u0440\u043d\u044b\u043c<\/a>.<\/p>\n<p>  \u0442\u0430\u043a\u0436\u0435, html2canvas, \u043d\u0435 \u0443\u043c\u0435\u0435\u0442 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c canvas \u0438\u0437 \u043a\u043e\u0434\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043a\u0430\u043a\u043e\u0439-\u043d\u0438\u0431\u0443\u0434\u044c \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442. \u041f\u043b\u044e\u0441 \u043e\u043d \u043d\u0435 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u044b\u0432\u0430\u0435\u0442 \u043d\u0435\u0432\u0438\u0434\u0438\u043c\u044b\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b. \u0413\u0434\u0435-\u0442\u043e \u043d\u0430 stackoverflow \u0441\u043e\u0432\u0435\u0442\u043e\u0432\u0430\u043b\u0438 iframe, \u043b\u0438\u0447\u043d\u043e \u044f \u0434\u043e\u0431\u0430\u0432\u0438\u043b div \u0441 position:absolute \u0438 left:-9999, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u043c\u0435\u0448\u0430\u043b (\u043f\u0440\u0430\u0432\u0434\u0430, \u043d\u0430 \u043f\u043b\u0430\u043d\u043a\u0435\u0440\u0435 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0437\u0430\u0433\u043d\u0430\u0442\u044c \u0437\u0430 \u044d\u043a\u0440\u0430\u043d)<\/p>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0438 \u043d\u0430\u0440\u0435\u0437\u043a\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b: \u043a\u043e\u043b\u043e\u043d\u043a\u0438 \u0440\u0430\u0437\u043d\u044b\u0435. \u042f \u044d\u0442\u043e \u0432\u044b\u043b\u0435\u0447\u0438\u043b, \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0441\u0442\u0438\u043b\u044c:  <\/p>\n<pre><code class=\"css\"> .table-fixed-width {     table-layout: fixed; } <\/code><\/pre>\n<p>  \u0412\u043e\u0442 \u0441\u0430\u043c \u043f\u0440\u0438\u043c\u0435\u0440: <a href=\"http:\/\/plnkr.co\/edit\/r3BaDwHpK5H9giwpqrBb\">plnkr.co\/edit\/r3BaDwHpK5H9giwpqrBb<\/a><\/p>\n<p>  \u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435: \u043f\u0438\u0441\u0430\u0442\u044c \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434\u044b \u2014 \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u043b\u043e\u0445\u043e. \u041d\u0435\u0440\u0435\u0434\u043a\u043e \u044d\u0442\u043e \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0443\u0437\u043d\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u043d\u043e\u0432\u043e\u0435. \u041e\u0434\u043d\u0430\u043a\u043e \u044d\u0442\u043e \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c\u0441\u044f \u043f\u0440\u0438\u0432\u044b\u0447\u043a\u043e\u0439, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0441\u0435\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u0447\u0438\u0442\u0430\u0442\u044c \u0434\u043e\u043a\u0438, \u0445\u043e\u0442\u044f \u0431\u044b \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b <s>\u0441\u043b\u0435\u0433\u043a\u0430<\/s> \u043f\u043e\u043f\u0441\u0438\u0445\u043e\u0432\u0430\u0442\u044c.<\/p>\n<p>  \u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u0447\u0442\u043e \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u043a\u043e\u043c\u0443-\u0442\u043e \u043f\u043e\u043c\u043e\u0436\u0435\u0442, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043d\u0430\u0434\u0435\u044e\u0441\u044c \u0443\u0441\u043b\u044b\u0448\u0430\u0442\u044c \u0432\u0430\u0448\u0438 \u0441\u043e\u0432\u0435\u0442\u044b \u0438 \u0438\u0434\u0435\u0438.        \t<\/p>\n<div class=\"polling\">\n<form action=\"\/json\/polling\/\" class=\"poll\" method=\"post\">\n<div class=\"poll_title\">\u041a\u0430\u043a\u043e\u0439 \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 PDF \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435?<\/div>\n<p>  \t\t<input type=\"hidden\" name=\"post_id\" value=\"278047\"\/> \t\t<input type=\"hidden\" name=\"polling_question_id\" value=\"14651\"\/>  \t\t<\/p>\n<table class=\"answer\">\n<tr>\n<td class=\"input\"> \t\t\t\t\t<input type=\"radio\" id=\"vv71597\" \t\t\t\t\t\tclass=\"radio js-field-data\" \t\t\t\t\t\tname=\"variant[]\" \t\t\t\t\t\tvalue=\"71597\" \/> \t\t\t\t<\/td>\n<td class=\"label\"> \t\t\t\t\t<label for=\"vv71597\">jsPDF<\/label> \t\t\t\t<\/td>\n<\/tr>\n<tr>\n<td class=\"input\"> \t\t\t\t\t<input type=\"radio\" id=\"vv71599\" \t\t\t\t\t\tclass=\"radio js-field-data\" \t\t\t\t\t\tname=\"variant[]\" \t\t\t\t\t\tvalue=\"71599\" \/> \t\t\t\t<\/td>\n<td class=\"label\"> \t\t\t\t\t<label for=\"vv71599\">pdfmake<\/label> \t\t\t\t<\/td>\n<\/tr>\n<tr>\n<td class=\"input\"> \t\t\t\t\t<input type=\"radio\" id=\"vv71601\" \t\t\t\t\t\tclass=\"radio js-field-data\" \t\t\t\t\t\tname=\"variant[]\" \t\t\t\t\t\tvalue=\"71601\" \/> \t\t\t\t<\/td>\n<td class=\"label\"> \t\t\t\t\t<label for=\"vv71601\">PDFKit<\/label> \t\t\t\t<\/td>\n<\/tr>\n<tr>\n<td class=\"input\"> \t\t\t\t\t<input type=\"radio\" id=\"vv71603\" \t\t\t\t\t\tclass=\"radio js-field-data\" \t\t\t\t\t\tname=\"variant[]\" \t\t\t\t\t\tvalue=\"71603\" \/> \t\t\t\t<\/td>\n<td class=\"label\"> \t\t\t\t\t<label for=\"vv71603\">\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u044e \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430<\/label> \t\t\t\t<\/td>\n<\/tr>\n<tr>\n<td class=\"input\"> \t\t\t\t\t<input type=\"radio\" id=\"vv71605\" \t\t\t\t\t\tclass=\"radio js-field-data\" \t\t\t\t\t\tname=\"variant[]\" \t\t\t\t\t\tvalue=\"71605\" \/> \t\t\t\t<\/td>\n<td class=\"label\"> \t\t\t\t\t<label for=\"vv71605\">\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u043b\u044e\u0431\u044b\u0435 (\u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438)<\/label> \t\t\t\t<\/td>\n<\/tr>\n<tr>\n<td class=\"input\"> \t\t\t\t\t<input type=\"radio\" id=\"vv71607\" \t\t\t\t\t\tclass=\"radio js-field-data\" \t\t\t\t\t\tname=\"variant[]\" \t\t\t\t\t\tvalue=\"71607\" \/> \t\t\t\t<\/td>\n<td class=\"label\"> \t\t\t\t\t<label for=\"vv71607\">\u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e<\/label> \t\t\t\t<\/td>\n<\/tr>\n<tr>\n<td class=\"input\"> \t\t\t\t\t<input type=\"radio\" id=\"vv71609\" \t\t\t\t\t\tclass=\"radio js-field-data\" \t\t\t\t\t\tname=\"variant[]\" \t\t\t\t\t\tvalue=\"71609\" \/> \t\t\t\t<\/td>\n<td class=\"label\"> \t\t\t\t\t<label for=\"vv71609\">\u0441\u0432\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 (\u043f\u043e\u0434\u0435\u043b\u0438\u0442\u0435\u0441\u044c \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445)<\/label> \t\t\t\t<\/td>\n<\/tr>\n<\/table>\n<p class=\"total\">\u041d\u0438\u043a\u0442\u043e \u0435\u0449\u0451 \u043d\u0435 \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u0430\u043b. \u0412\u043e\u0437\u0434\u0435\u0440\u0436\u0430\u0432\u0448\u0438\u0445\u0441\u044f \u043d\u0435\u0442.<\/p>\n<\/p><\/form>\n<p class=\"for_users_only_msg\">\u0422\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u043c\u043e\u0433\u0443\u0442 \u0443\u0447\u0430\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0432 \u043e\u043f\u0440\u043e\u0441\u0435. <a href=\"https:\/\/habrahabr.ru\/auth\/login\/\">\u0412\u043e\u0439\u0434\u0438\u0442\u0435<\/a>, \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430.<\/p>\n<\/p><\/div>\n<div class=\"clear\"><\/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=\"https:\/\/habrahabr.ru\/post\/278047\/\"> https:\/\/habrahabr.ru\/post\/278047\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>       \u0413\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f PDF\u2026 \u042d\u0442\u0430 \u0442\u0435\u043c\u0430 \u043d\u0435 \u043d\u043e\u0432\u0430, \u043e\u0434\u043d\u0430\u043a\u043e \u043f\u043e\u0440\u043e\u0439 \u043c\u043e\u0436\u043d\u043e \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u0442\u044c\u0441\u044f \u0441 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0442\u043e\u043d\u043a\u043e\u0441\u0442\u044f\u043c\u0438, \u0432 \u0438\u0442\u043e\u0433\u0435 \u0441\u0442\u0430\u0432 \u043d\u0430 \u0442\u0435\u0440\u043d\u0438\u0441\u0442\u044b\u0439 \u043f\u0443\u0442\u044c \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f. \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443, \u043a\u0430\u043a \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043b \u043e\u0434\u0438\u043d \u0442\u0430\u043a\u043e\u0439 \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434.<\/p>\n<p>  \u041c\u043d\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u043b\u043e\u0441\u044c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e \u043e\u0442\u0447\u0435\u0442\u043e\u0432 \u0432 PDF. \u041f\u043e \u0440\u044f\u0434\u0443 \u043f\u0440\u0438\u0447\u0438\u043d \u044f \u0440\u0435\u0448\u0438\u043b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u043a\u043b\u0438\u0435\u043d\u0442\u0430. \u0411\u0435\u0433\u043b\u044b\u0439 \u043f\u043e\u0438\u0441\u043a \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u043b \u043c\u043d\u0435 \u0432\u044b\u0431\u043e\u0440 \u043c\u0435\u0436\u0434\u0443 <a href=\"http:\/\/mrrio.github.io\/jsPDF\/\">jsPDF<\/a> \u0438 <a href=\"http:\/\/pdfmake.org\/playground.html\">pdfmake<\/a>. \u041e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0441\u044f \u043d\u0430 \u043f\u0435\u0440\u0432\u043e\u043c. \u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435\u2026<\/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-275048","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/275048","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=275048"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/275048\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=275048"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=275048"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=275048"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}