Member-only story

David Li
4 min readFeb 2, 2023

--

title img

To create a resume in PDF format using Flutter, you can use a library like pdf.dart or pdf_flutter. Both of these libraries allow you to generate PDF documents from within a Flutter app by rendering Flutter widgets and layouts to PDF pages.

Here’s an example of how you could use the pdf.dart library to create a simple resume PDF in dart:

  1. First, add the pdf.dart library to your dart project by adding the following line to your pubspec.yaml file:
dependencies:
pdf: ^1.5.1
  1. Import the pdf library in your Flutter code:
import 'package:pdf/pdf.dart';
import 'package:pdf/widgets.dart' as pw;
  1. Create a function that generates the PDF document. This function should return a PdfDocument object, which represents the PDF document. You can use the pw prefix to access the widgets provided by the pdf library, such as pw.Paragraph, pw.Table, and pw.Column.
PdfDocument generateResumePdf() {
final document = PdfDocument();
final page = pw.Page(
pageFormat: PdfPageFormat.a4,
build: (pw.Context context) {
return pw.Column(
children: <pw.Widget>[
...
],
);
},
);
document.addPage(page);
return document;
}

To create a header for the resume, you can use the pw.Header widget with a pw.Text widget as its child. You can use the level property of the…

--

--

David Li
David Li

Written by David Li

Software developer that is an active bogger.

No responses yet