View Issue Details

IDProjectCategoryView StatusLast Update
0003180ScribusImport / Exportpublic2006-05-09 22:55
Reporterthomasnexedi Assigned Tofschmid  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionno change required 
Platformx86_32OSLinuxOS Versionall
Product Version1.3 
Fixed in Version1.3.3cvs 
Summary0003180: checkboxes are badly exported to PDF
DescriptionThe checkboxes created as PDF interractive objects are not rendered correctly when the file is exported to PDF.

According to pdftk (the software used to fill the form) and all other PDF-Form generators, checkboxes must have a "FieldStateOption:" to "Yes" so that they can be visually checked.

Unfortunately this is not the case with Scribus : the field has only the "FieldStateOption: On" that does not enable it to be checked.

It was already predent on an older Scribus release (1.2.2) before I updated.

I am a bit sad that Scribus can not do that, as is it a very powerfull software to manage files and PDFs
Steps To Reproducecreate a new Scribus document, add some PDF-fields with some checkboxes.
Export you document into a PDF file.

Once this is done, just use a fill-compliant sofware (I recommend pdftk under Linx) and try to merge the PDF with a FDF and see the result. The field is not rendered at all, and this is true for a lot of viewers : Acrobat reader 7, Xpdf, Kpdf, KGhostview, etc. (in fact all the viewers I tried).
TagsNo tags attached.
Patch

Relationships

related to 0000866 closedfschmid Implement check box radio behaviour in PDF forms 
related to 0003282 closedfschmid Fonts don't work with text fields of forms. 
child of 0003831 acknowledged Metabug: PDF Forms 

Activities

thomasnexedi

2006-02-08 11:15

reporter   ~0008667

I looked to the code of the last release available at the moment, and it seems that PDF exportation does not match PDF convention as declared here : http://partners.adobe.com/public/developer/en/pdf/PDFReference15_v6.pdf page 625 in section 8.6.3 'FieldTypes' (or any other PDF release available on Adobe's website).

PDF checkboxes must be defined with at least two status : a checked status (usually named 'Yes') and an unchecked status (usually named 'Off'... I know this sounds stange : why not using 'Yes'/'No' or 'On'/'Off'...).

It looks like checkboxes are generated as standard annotations, and so are not rendered correctly.

So Scribus should generate a button object with two states instead of one :
code of 'pdflib.cpp' from line 2995 in checkbox creation.

<code>
PutDoc("/FT /Btn\n");
PutDoc(ite->AnIsChk ?
       "/V /On\n/DV /On\n/AS /On\n" :
       "/V /Off\n/DV /Off\n/AS /Off\n");
PutDoc("/AP << /N << /On "+IToStr(ObjCounter)+" 0 R >> >>\n");
</code>

the last line does not comply and should be something like that (see below) to allow two status (checked and unchecked).

<code>
PutDoc("/AP << /N << /On "+IToStr(ObjCounter)+" 0 R /Off" +IToStr(ObjCounter + 1 ) "+>> >>\n");
</code>

then the processing of the second object declared for the 'Off' status should be implemented as a checked value.


To have more informations on the way checkboxes are used, see PDF Reference book page 627 that describes the following example (extract from page 627)
<code>
1 0 obj
<< /FT /Btn
/T (Urgent)
/V /Yes
/AS /Yes
/AP << /N << /Yes 2 0 R /Off 3 0 R>>
>>
endobj
2 0 obj
<< /Resources 20 0 R
/Length 104
>>
stream
q
0 0 1 rg
BT
/ZaDb 12 Tf
0 0 Td
(8) Tj
ET
Q
endstream
endobj
3 0 obj
<< /Resources 20 0 R
/Length 104
>>
stream
q
0 0 1 rg
BT
/ZaDb 12 Tf
0 0 Td
(8) Tj
ET
Q
endstream
endobj
</code>

I will try to correct the issue and submit a patch as soon as possible (and if possible ;) )...

fschmid

2006-02-08 16:25

developer   ~0008671

> According to pdftk (the software used to fill the form) and all other
> PDF-Form generators, checkboxes must have a "FieldStateOption:" to "Yes"
> so that they can be visually checked.
 
This "Yes" can safely replaced by "On" as the PDF-1.6 Reference says:
"The recommended (bug not required) name for the on state is Yes"
Page 648, end first paragraph of "Check Boxes"

thomasnexedi

2006-02-20 14:54

reporter   ~0008830

Thanks for your quick answer fschmid (even if I could not get any internet connexion last week), but this does not fix the bug I have.

I think I badly explained my issue because I had a closer look to the PDF reference book and it is well said the sfield name is just a suggestion and basically 'On' instead of 'Yes' should work (as you explain to me).

But when I am testing it is not the case :S
I export a PDF document containing checkbox fields from a scribus file, then I generate a fdf filling doument to fill the form content. After that I decided to merge fdf content with pdf form uing pdftk.
The result is a flatten PDF file, with all the usual fields filled (date fields, integerfields, stringfields, textAreafields, etc.) but NOT the checkbox fields.

I can not find where is the bug, as this fdf comply with this example : http://accesspdf.com/html_pdf_form/. The only difference seems that the PDF file in the example has not been generated through Sribus...

PS : you can find here the different files I used :
Scribus original document : http://cartemere.online.fr/info/nexedi/test-upload-2006.sla
PDF original document : http://cartemere.online.fr/info/nexedi/test-upload-2006.pdf
FDF document : http://cartemere.online.fr/info/nexedi/fdf_temp_file
PDF Final result : http://cartemere.online.fr/info/nexedi/PDFfinal.pdf

2006-05-04 20:15

 

form_merged_with_fdf.png (102,254 bytes)   
form_merged_with_fdf.png (102,254 bytes)   

mhanski

2006-05-04 20:27

developer   ~0010919

thomasnexedi:
<quoting>The result is a flatten PDF file, with all the usual fields filled (date fields, integerfields, stringfields, textAreafields, etc.) but NOT the checkbox fields.</quoting>

Before we go too deep into it: I've just looked at your PDFfinal.pdf in Adobe Reader 7.01 for Linux and can see your checkboxes, some of them checked (see the uploaded screen shot). What am I missing here? Are you sure, you've tested with acroread too?

thomasnexedi

2006-05-09 12:44

reporter   ~0011140

I was working with an old live-CD of a modified release of Mandriva, and the Acroread present on the cd was not the last release (7.0.0 if I well remember).

Now I'm working on my own laptop computer with an updated release and Acrobat Reader 7.01 : I've just made a new test after reading your note and everything is rendered fine !

The fact is : this works, and that's what I wanted !

Thanks a lot !

But I'm still thinking this is a very stange issue : filling with pdftk forms generated by any pdf generator works with all pdf sofwares I tested, whereas forms generated by Scribus and filled using pdftk does work only with the recent releases of Acrobat... ?!

Why pdf generated from Scribus can not be correctly rendered in all pdf viewers when filled using pdftk ?

mhanski

2006-05-09 13:24

developer   ~0011145

thomasnexedi: I'm resolving this now as "no change required". Thanks for your feedback.

Regarding your last question: please join our very friendly and helpful mailing list to ask such questions, you won't regret it:

http://nashi.altmuehlnet.de/mailman/listinfo/scribus

Issue History

Date Modified Username Field Change
2006-02-06 17:35 thomasnexedi New Issue
2006-02-08 11:15 thomasnexedi Note Added: 0008667
2006-02-08 13:04 cbradney Status new => assigned
2006-02-08 13:04 cbradney Assigned To => fschmid
2006-02-08 16:25 fschmid Note Added: 0008671
2006-02-09 07:20 fschmid Status assigned => resolved
2006-02-09 07:20 fschmid Fixed in Version => 1.3.3cvs
2006-02-09 07:20 fschmid Resolution open => fixed
2006-02-10 00:47 mhanski Relationship added related to 0000866
2006-02-20 14:54 thomasnexedi Status resolved => feedback
2006-02-20 14:54 thomasnexedi Resolution fixed => reopened
2006-02-20 14:54 thomasnexedi Note Added: 0008830
2006-03-14 00:46 cbradney Relationship added child of 0003402
2006-03-26 00:03 plinnell Relationship deleted child of 0003402
2006-04-17 14:09 mhanski Product Version 1.3.0 => 1.3
2006-04-19 17:26 mhanski Relationship added related to 0003282
2006-05-04 20:15 mhanski File Added: form_merged_with_fdf.png
2006-05-04 20:27 mhanski Note Added: 0010919
2006-05-09 12:44 thomasnexedi Note Added: 0011140
2006-05-09 13:24 mhanski Note Added: 0011145
2006-05-09 13:24 mhanski Status feedback => resolved
2006-05-09 13:24 mhanski Resolution reopened => no change required
2006-05-09 22:54 mhanski Status resolved => closed
2006-05-17 17:45 mhanski Relationship added child of 0003831