Converting HTML forms to PDF

I have an HTML form that I’m trying to convert to PDF/A using LO. (rightly or wrongly I’m just using the same form the users fill out.)

Headless always insists on inserting a blank first page into the file, which is always a fillable PDF form, when what I want is an archive. If I use the Gui I get what I want, and I’ve been told that headless will then use those settings. It won’t.

Anyway, I’d rather not try to duplicate the for as either straight HTML or ODT. I’m also aware of Unoconv, but wary of spending several hours to demonstrate that it works just like headless.

Has anyone any other suggestions?

Thanks

OK, here we go again. I don’t see how to comment on QBit’s second answer, so I’m posting as an “answer” myself.

Anyway:

I have used LO to convert .doc and .odt to PDF, with success. I have never tried HTML before, but HTML → PDF is in the documentation as working, and in my immediate experience it does except for this anomaly.

I agree it is quite possible that I am describing two separate problems. It is also two contemporaneous and colocated instances of unexpected behavior. In my experience it is safer to report something like that, than not.

I’m about 95% sure that the form being two pages long when all the data is on one page is a flat out bug.

I do not know whether having LO produce a fillable form if input doc contains <form> tags, and a static PDF if it does not is as designed, or not. I find that if I use the GUI to export a PDF of the form file, it will default to a static document, and that I must tell it to export a form. The command line flat out does a form, period, the end. I do find it odd that the GUI and the command line should have different defaults, as they appear to.

The idea that the command line would take the options that cannot be specified on the command line from the last settings in the GUI came from a thread here on “ask” last spring. The docs are silent on the subject. I’ve commented on that thread that there are, at least, exceptions.

OK, I’ll go play with 4.0 and see what it does.

@granolageek – It sounds like you think that there are some bugs here, and based on all of the legwork you’ve done, I’m pretty inclined to believe you :slight_smile:

I would definitely try to write up some bugs for these things. Only a handful of our developers frequent the Ask site, and if there’s something that you’d like to get in front of their eyes, a well-written, narrowly-focused bug will probably get their attention faster than a thread on the Ask site.

@granolageek – Here’s the link to file a bug.

Please post a link to any bugs you file in a comment below using the format “fdo#123456”.

Thanks!

I’m sorry, I don’t immediately see how to link to another thread. However, according to this one “unoconv headless multiple options, secure PDF”, it strongly appears that the problem lies in LO (v3.6 for me), and unoconv suffers from it too.

Hi @granolageek, The thread you reference has an answer from @dag (developer of unoconv) that indicates that there was a bug (now fixed) in the unoconv source. From what shared problem do you believe both LO 3.6 and unoconv are suffering?

The last response, from Terry Carmen, saying that he had put debugging code into unoconv, seen it pass the parameters to LO, and seen them have no effect.

0

answered Aug 19 '12
Terry Carmen gravatar image Terry Carmen
1

It doesn’t work here either.

I added debugging code to unoconv and the parameters do seem to be passed to LO, although they don’t seem to have any effect. I can’t generate any sort of protected PDF either.

LO does create a prote

Terry Carmen’s comment appears to predate @dag’s (Aug 19 vs. Aug 20), so perhaps Carmen was just using an older (and unfixed) version of LO? Please try a LO 4.0 build and provide us with repro steps on what features aren’t working for you in unoconv or in LO.

Sorry, I’m still learning my way around. I hadn’t noticed that comments are in chronological order and answers are in reverse chronological order. I can deal, but the practice will be found in no ease of use manual, ever.

@granolageek – I have a few q’s about your original question.

I have an HTML form that I’m trying to convert to PDF/A using LO. (rightly or wrongly I’m just using the same form the users fill out.)

Is this something you’ve done before with success? (I haven’t used LO for this purpose)

Headless always insists on inserting a blank first page into the file, which is always a fillable PDF form, when what I want is an archive.

I’m confused. It sounds like you’re describing two separate problems

  1. Headless mode inserts a blank first page.
  2. You want an archive (compressed file?), but presumably you’re not getting an archive

If I use the Gui I get what I want, and I’ve been told that headless will then use those settings. It won’t.

What settings have you configured in the GUI that you expect to carry over into headless mode? Is there documentation that indicates that headless will use the settings configured in the GUI?

I had similar is similar issue while converting html to pdf. After I inserted meta tag in htm head pdf generated without blank.

I signed up just to say thank you! Adding the meta tags fixes the blank first page problem.

Thank you too very much. Adding the meta tags works also for me.