Hey Logan,
Sorry I must’ve copy pasted that wrong. The XFDF string is definitely correct when it’s used in our code, because as I mentioned earlier signatures do work and show up fine in the final merged PDF, but the input fields stay blank. Here is the correct formatted XFDF for a test I just ran:
<?xml version="1.0" encoding="UTF-8" ?>
<xfdf
xmlns="http://ns.adobe.com/xfdf/" xml:space="preserve">
<fields>
<field name="project_number">
<value>1334</value>
</field>
<field name="building_name_or_location">
<value></value>
</field>
<field name="room_numbers">
<value>qecqec</value>
</field>
<field name="name">
<value>qec</value>
</field>
<field name="department_title">
<value>qccq</value>
</field>
<field name="name_of_department_head">
<value>qerqer</value>
</field>
<field name="name_of_dean">
<value></value>
</field>
<field name="name_of_vp">
<value></value>
</field>
<field name="signature_3">
<value></value>
</field>
<field name="signature_3_date">
<value></value>
</field>
<field name="signature_2">
<value></value>
</field>
<field name="signature_2_date">
<value></value>
</field>
<field name="signature_1">
<value></value>
</field>
<field name="signature_1_date">
<value>Mar 15, 2022 7:12 PM</value>
</field>
<field name="first_question">
<value>qefqfe</value>
</field>
<field name="second_question">
<value>qefqef</value>
</field>
<field name="project_justification">
<value>qefqef</value>
</field>
<field name="project_description">
<value></value>
</field>
<field name="index_code">
<value></value>
</field>
<field name="name_of_pm">
<value></value>
</field>
<field name="signature_4">
<value></value>
</field>
<field name="signature_4_date">
<value></value>
</field>
<field name="authorized_signature_name">
<value></value>
</field>
<field name="signature_5">
<value></value>
</field>
<field name="signature_5_date">
<value></value>
</field>
<field name="pm_comments">
<value></value>
</field>
</fields>
<annots>
<ink page="0" rect="308.963,442.766,361.380,472.088" color="#000000" flags="print" name="18a18011-edef-19d9-fe10-9323b23e035f" title="Guest" subject="Signature" date="D:20220315191251-03'00'" creationdate="D:20220315191251-03'00'">
<trn-custom-data bytes="{"trn-annot-maintain-aspect-ratio":"true"}"/>
<inklist>
<gesture>334.3160945157527,471.82568728121356;334.3160945157527,471.82568728121356;334.0309719953326,471.5405647607935;333.7458494749125,470.97031971995335;331.1797467911319,466.4083593932322;329.1838891481914,462.7017666277713;324.90705134189034,453.5778459743291;322.9111936989499,450.15637572928824;319.7748459743291,445.024170361727;317.7789883313886,443.0283127187865;313.7872730455076,443.31343523920657;311.7914154025671,445.8795379229872;309.5104352392066,454.1480910151692;309.2253127187865,456.7141936989498;309.5104352392066,461.56127654609105;310.9360478413069,462.7017666277713;320.05996849474917,460.70590898483084;326.04754142357064,457.8546837806301;338.8780548424738,450.15637572928824;344.0102602100351,447.02002800466744;349.99783313885655,443.8836802800467;353.4193033838974,443.0283127187865;358.2663862310386,444.4539253208868;359.40687631271885,445.5944154025671;361.11761143523927,448.7307631271879</gesture>
</inklist>
</ink>
</annots>
<pages>
<defmtx matrix="1,0,0,-1,0,841.91998" />
</pages>
</xfdf>
Also here is the final PDF this XFDF is giving me:
merged.pdf (592.2 KB)
As you can see the signature I added shows up fine, but the input text from other fields in the XFDF don’t show up.
Looking at this XFDF a bit closer I noticed the input fields and the signature are in different sections. The signature is in the “annots” section. Do I have to do something special to merge the field values onto the PDF? Seems like only annotations are getting merged, and none of the field values.