HTML 코드 템플릿에서 PDF 문서를 생성할 수 있는 플러터 플러그인입니다. HTML과 CSS를 통해 풍부하고 스타일이 적용된 콘텐츠를 직접 렌더링할 수 있어, 플러터 앱 내에서 청구서, 보고서 및 인쇄 가능한 문서를 만들기에 적합합니다. 이 플러그인은 안드로이드와 iOS 플랫폼을 지원하며 기존의 HTML 기반 디자인과 원활하게 통합됩니다. 네이티브 렌더링 기능을 활용하여 장치 간에 일관된 형식으로 고품질 출력을 보장합니다.
Code above simply generates PDF file from HTML content. It should work with most of common HTML markers. You don’t need to add .pdf extension to targetFileName because plugin only generates PDF files and extension will be added automatically.
Other Usages
You can also pass File object with HTML content inside as parameter
var file = File("/sample_path/example.html");
var generatedPdfFile = awaitFlutterHtmlToPdf.convertFromHtmlFile(
file, targetPath, targetFileName);
or even just path to this file
var filePath = "/sample_path/example.html";
var generatedPdfFile = awaitFlutterHtmlToPdf.convertFromHtmlFilePath(
filePath, targetPath, targetFileName);
Images
If your want to add local image from device to your HTML you need to pass path to image as src value.