<p>The <code>.XFDL</code> file extension identifies <code>XFDL</code> Formatted Document files. These belong to the XML-based document and template formatting standard. This format is exactly like the XML file format however, contains a level of encryption for use in secure communications.</p>

<p>I know how to view XFDL files using a file viewer I found <a href="http://web.archive.org/web/20170903022252/http://www.e-publishing.af.mil:80/viewerdownload.asp" rel="nofollow noreferrer">here</a>.  I can also modify and save these files by doing File:Save/Save As.  I'd like, however, to modify these files on the fly. Any suggestions? Is this even possible?</p>

<p>Update #1: I have now successfully decoded and unziped a <code>.xfdl</code> into an XML file which I can then edit. Now, I am looking for a way to re-encode the modified XML file back into base64-gzip (using Ruby or the command line)</p>

[{'answer_id': 1628, 'author': 'saniul', 'author_id': 52, 'author_profile': 'https://Stackoverflow.com/users/52', 'pm_score': 4, 'selected': True, 'text': '<p>If the encoding is <strong>base64</strong> then this is the solution I\'ve stumbled upon on the web:</p>\n\n<p>"Decoding XDFL files saved with \'encoding=base64\'.\nFiles saved with: </p>\n\n<pre><code>application/vnd.xfdl;content-encoding="base64-gzip"\n</code></pre>\n\n<p>are simple base64-encoded gzip files. They can be easily restored to XML by first decoding and then unzipping them. This can be done as follows on Ubuntu:</p>\n\n<pre><code>sudo apt-get install uudeview\nuudeview -i yourform.xfdl\ngunzip -S "" &lt; UNKNOWN.001 &gt; yourform-unpacked.xfdl \n</code></pre>\n\n<p>The first command will install uudeview, a package that can decode base64, among others. You can skip this step once it is installed.</p>\n\n<p>Assuming your form is saved as \'yourform.xfdl\', the uudeview command will decode the contents as \'UNKNOWN.001\', since the xfdl file doesn\'t contain a file name. The \'-i\' option makes uudeview uninteractive, remove that option for more control.</p>\n\n<p>The last command gunzips the decoded file into a file named \'yourform-unpacked.xfdl\'.</p>\n\n<p><strong>Another</strong> possible solution - <a href="http://www.chilkatsoft.com/p/p_531.asp" rel="nofollow noreferrer">here</a></p>\n\n<p><em>Side Note: Block quoted &lt; code > doesn\'t work for long strings of code</em></p>\n'}, {'answer_id': 1647, 'author': 'saniul', 'author_id': 52, 'author_profile': 'https://Stackoverflow.com/users/52', 'pm_score': 2, 'selected': False, 'text': '<p>The only answer I can think of right now is - read the manual for uudeview.</p>\n\n<p>As much as I would like to help you, I am not an expert in this area, so you\'ll have to wait for someone more knowledgable to come down here and help you.</p>\n\n<p>Meanwhile I can give you links to some documents that might help you:</p>\n\n<ul>\n<li><a href="http://www.fpx.de/fp/Software/UUDeview/" rel="nofollow noreferrer">UUDeview Home Page</a></li>\n<li><a href="http://xdflengine.sourceforge.net/doc_1037.html" rel="nofollow noreferrer">Using XDFLengine</a></li>\n<li><a href="http://xdflengine.sourceforge.net/doc_1044.pdf" rel="nofollow noreferrer">Gettting started with the XDFL Engine</a></li>\n</ul>\n\n<p>Sorry if this doesn\'t help you.</p>\n'}, {'answer_id': 3375, 'author': 'Federico Builes', 'author_id': 161, 'author_profile': 'https://Stackoverflow.com/users/161', 'pm_score': 1, 'selected': False, 'text': '<p>You don\'t have to get out of Ruby to do this, can use the Base64 module in Ruby to encode the document like this:</p>\n\n<pre><code>irb(main):005:0&gt; require \'base64\'\n=&gt; true\n\nirb(main):007:0&gt; Base64.encode64("Hello World")\n=&gt; "SGVsbG8gV29ybGQ=\\n"\n\nirb(main):008:0&gt; Base64.decode64("SGVsbG8gV29ybGQ=\\n")\n=&gt; "Hello World"\n</code></pre>\n\n<p>And you can call gzip/gunzip using Kernel#system:</p>\n\n<pre><code>system("gzip foo.something")\nsystem("gunzip foo.something.gz")\n</code></pre>\n'}]
['https://Stackoverflow.com/questions/1615', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/25/']