PDF forms in Scribus 1.5 always submits data in FDF format

Previous topic - Next topic

simonbaev

Hello,

I am working on Scribus 1.5.0. (Build ID: C-C-T-F-C1.14.2-64bit) on Ubuntu 15.04.

A PDF form has 'submit' button with URL pointing to some webserver that I can control. No matter which "Submit format" I use in configuration of the button properties, it always send data to server in FDF format. I can see it by running

sudo tcpdump -nl -w - -i eth0 -c 500 port 80 | strings

on web server to get something similar to

tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes
POST /~simon.baev/FDF/index.php HTTP/1.1
Host: stapps.gswcm.net
Connection: keep-alive
Content-Length: 963
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.157 Safari/537.36
Origin: chrome-extension://mhjfbmdgcfjbbpaeojofohoefgiehjai
Accept: */*
DNT: 1
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.8,ru;q=0.6
%FDF-1.2
1 0 obj
<</FDF<</F<</Type/Filespec/F(file:///home/gswcm/Projects/Temp/FACE_submit.pdf)/UF(file:///home/gswcm/Projects/Temp/FACE_submit.pdf)>>/Fields[<</T(first_name)/V(Simon)>><</T(dob)/V<>>><</T(today)/V<>>><</T(last_name)/V(Baev)>><</T(email)/V<>>><</T(cell_number)/V<>>><</T(local_address)/V<>>><</T(home_country)/V<>>><</T(citizenship)/V<>>><</T(area_of_study)/V<>>><</T(graduation_date)/V<>>><</T(spouse_name)/V<>>><</T(children_name)/V<>>><</T(how_long_in_USA)/V<>>><</T(languages)/V<>>><</T(diet)/V<>>><</T(gender_m)/V/Off>><</T(gender_f)/V/Off>><</T(smoker_yes)/V/Off>><</T(smoker_no)/V/smoker_no>><</T(like_children_yes)/V/Off>><</T(like_children_no)/V/Off>><</T(like_pets_yes)/V/Off>><</T(like_pets_no)/V/Off>><</T(pet_preferences)/V<>>><</T(allergies)/V<>>><</T(hobbies)/V<>>><</T(like_face)/V<>>><</T(like_americus)/V<>>><</T(children_preference)/V<FEFF002D002D>>><</T(place_to_visit)/V<>>>]>>>>
endobj
trailer
<</Root 1 0 R>>
%%EOF
HTTP/1.1 200 OK
Date: Tue, 25 Aug 2015 02:39:10 GMT
Server: Apache/2.4.7 (Ubuntu)
X-Powered-By: PHP/5.5.9-1ubuntu4.11
Content-Length: 0
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: text/html
^C12 packets captured
12 packets received by filter
0 packets dropped by kernel


It doesn't matter which "Submit format" is specified prior exporting Scribus project into PDF it always sends FDF data.

I double checked that changing "Submit format" is Scribus project is reflected in *.sla file in the value of ANHTML parameter which takes values 0,1,2,3 depending on which option was chosen. The exported PDF files are identical no matter which option was used in Scribus project prior exporting.

--
Simon

PS: I'm using Google Chrome to fill in PDF form and make the submission since builtin PDF viewer (Atril) does not support form submission.

Nermander

Try using Acrobat Reader for the form before concluding that the error lies in Scribus.

simonbaev

Nermander, thank you for prompt response

I will try using Acrobat Reader just to visit the last resort... but I doubt it will handle the fact that exported PDF files (solely Scribus business) are identical regardless which "Submit format" was set in the properties of the Submit button when I edited it Scribus.

Moreover Acrobat Reader for Linux is discontinued at version 9.5.3. and I wouldn't like to consider it as a "main PDF handling" software.

Nermander

You did a binary comparison between the files? I would guess that at least the time of creation inside the file would change, so the files would not be bytewise identical even if exported with the same settings.

Are you 100% sure you exported the new file in the right place? (It's not uncommon that files end up in another place than people expect, so they complain about the file not changing but are looking at the wrong file. Some version of Scribus had a bug where the displayed path was not the path where the file ended up, you had to explicitly navigate to the right folder to make the file end up there.)

I'm not saying that there is no bug in Scribus, I'm just helping to rule out other errors. Developers will have to comment on how the export code works.

simonbaev

I must apologize for making incorrect conclusions in a rush. Likely i was observing not changing PDF file because of caching effect of the network drive that I used to store these files.

I made a clear experiment with 2 input text fields and 4 submit buttons that have the same URL but different "Submit action". I exported this project into PDF and then, opened it in Adobe Acrobat X Pro to see the difference in properties of submit buttons. Here is the result

  • FDF in Scribus -> FDF "Field data" only in Acrobat
  • HTML in Scribus -> HTML in Acrobat
  • XFDF in Scribus -> FDF "Field data" + "Incremental changes to the PDF" in Acrobat
  • PDF in Scribus -> FDF "Field data" only in Acrobat (not a dedicated PDF option as I would expect)

In fact, when I submit the form from Acrobat Reader on Windows (opposite to my original experiment to submit it from Chrome browser on Linux), the "HTML" format works as expected and I can see URL encoded form data in the HTTP header on webserever while using tcpdump (as described in the first post).

When I use Chrome on Windows result is the same as Chrome on Linux -- every time it sends FDF regardless to which "submit action" is associated with submit button.

I guess I just need tp configure web server to accept FDF... because I wouldn't like to assume that everyone has Acrobat Reader as default PDF viewer.

Kunda

simon, this is very interesting. Do you mind writing a tutorial on this subject?
I especially like the tcpdump one liner.

simonbaev

Kunda, I would be happy to write a tutorial but I'm not sure what should it cover... I stole the tcpdump trick from https://systembash.com/simple-sysadmin-trick-using-tcpdump-to-sniff-web-server-traffic/


Kunda

For example,
Scenario: Create a PDF form that has a submit button; Put it online and have it send the information it asks for  somewhere useful.

Step 1: create a PDF form through scribus
Step 2: Sniff webserver to see how the data is encapsulated (and note issues that can arise like making sure to use Adobe Acrobat)
Step 3: Use the information that the form sends. Perhaps saving to a DB etc...




simonbaev

Sounds doable. I'm currently learning how FDF data can be handled on the web server, but once will step will be over I will be ready to create a tutorial.

What will be my steps to prepare and post the tutorial?

Kunda

Great! I recommend using something like Github (using markdown) or if you have a personal blog or you could use the Scribus Wiki.