Trabalhando com JSPDF COM対応

1736 ワード

ネスト・ドミンゴにおけるNuma Experi ' s NCIA - queの原因パラクェンn - o - oのconheceは、馬の図書館は、Gera emのPDFのようになります.
インフレーテ・ダミエム・アイダ・デ・デコンブリ・コモ・レゾール・エ・ヴォーク・アール・フォー・フィニ・フェリィズの共産主義者の物語Ma、O問題は、テキスト+ adicionar outra pをしますGina Automaticamente、AP通信は、Muita Pesquisa、consegui馬Solu oをoにします.
import { jsPDF as JsPDF } from 'jspdf';
import html2canvas from 'html2canvas';


const generatePdf = (): any => {
const htmlSource = document.getElementById('profile');
const filename = `Currículo ${fields.name}`;

if (!htmlSource) {
  return;
}

html2canvas(htmlSource).then(function (canvas) {
  const imgData = canvas.toDataURL('image/png');
  const imgWidth = 180;
  const pageHeight = 297;

  const imgHeight = (canvas.height * imgWidth) / canvas.width;
  let heightLeft = imgHeight;
  let position = 5;
  const pdf = new JsPDF('p', 'mm');

  pdf.addImage(imgData, 'PNG', 10, position, imgWidth, imgHeight);
  heightLeft -= pageHeight;

  while (heightLeft >= 0) {
    position = heightLeft - imgHeight;
    pdf.addPage();
    pdf.addImage(imgData, 'PNG', 10, position, imgWidth, imgHeight);
    heightLeft -= pageHeight;
  }
  pdf.save(filename);
});}; 
onclick ={ ()>> generateepf ()を使用します.
<研究ノート>地域における地域社会の形成と変容const pageHeight = 297; , パラオメーカモ297フィコボム.
ドキュメンツhttp://raw.githack.com/MrRio/jsPDF/master/docs/index.html
エスパーターアジャドド!