1

I'm trying to get my app to read a document (word or pdf) and generate a PDF from it, using variables to fill out certain parts.

I can't just let the user use a textinput as the ending PDF needs to respect Bolds, italics, identation, etc...

But I can't seem to find a way to do it.

Ondolin
  • 324
  • 2
  • 13
raiton
  • 101
  • 11

1 Answers1

0

I would say that Markdown is the most used solution.

You can insert whatever you want to the file, and then render it to PDF.

Ondolin
  • 324
  • 2
  • 13
  • How would I read the markdown of a doc file and then generate a PDF with that? – raiton Mar 03 '21 at 11:41
  • There are different options for you. [here](https://stackoverflow.com/questions/16383237/how-can-doc-docx-files-be-converted-to-markdown-or-structured-text) are shown some. – Ondolin Mar 03 '21 at 11:49
  • If you want to do it in flutter I would recommend to use a backend to convert the doc to a PDF using pandoc. – Ondolin Mar 03 '21 at 11:51
  • I can't afford a server. All I want is for ppl to submit a file stored on google docs for example, and to read it, change the variables and post a PDF – raiton Mar 03 '21 at 17:50
  • If you want to do it for a fixed amount of documents, use pandoc in the command line and make the entire thing as a commandline tool. If you want to create a service you can use an old pc as Server or search for an api, which converts doc to markdown. But I really recommend using markdown, since the alternative is very little and bad. – Ondolin Mar 03 '21 at 17:56
  • this app is used by a few hundred ppl and I have no idea what their documents are. just the variables. I can't afford to have an old pc running – raiton Mar 03 '21 at 18:00