Wednesday, September 28, 2016

Guide to creating a "fillable" PDF

This post describes a process that I have used to create a form as a "fillable" PDF.

You must have a professional version of the Adobe Acrobat software.  I'm currently using Adobe Acrobat X Pro.  You'll also need a more recent version of Microsoft Word.  I'm using 2010.

First create the form as a word document and design it exactly how you want it to look.  For example:


Then on the File tab, select Save As Adobe PDF.  After it saves, it should open up in Acrobat.  If it opens in Reader, you need to close it and reopen it in Acrobat.

In Acrobat, click Tools, then Forms, then Create:


Choose the current document as the source.  Acrobat will examine the document and look for anything that appears to be a placeholder for a form field.  It then adds a PDF form field to that spot.  If there are any places that it didn't find, you will have to add them manually.  There is a lesson here.  When creating the form initially in Word, become familiar with what Acrobat is looking for, so there is less you have to do manually.


After the form is created, click the Close Form Editing option, and save.  At this point, you have a fillable PDF.  To Add a form field manually, choose Edit in the Forms menu, and then choose Add New Field.  You'll be given a choice of what type of field.  After placing and sizing the field, right click on the field and choose Properties to change the appearance.

Tips

  • To create a group of radio buttons (i.e. Yes/No, etc.) , create the radio button fields individually and name them the same thing, but give them different choice property values.
  • If you create a checkbox in the Word document, Acrobat will automatically set up the radio buttons for you.  However, if you put them in separate table cells, Acrobat won't group them together correctly.
  • To lock down the document, click Protection, More Protection, and Security Properties.  Choose Password Security as the Security Method.  Check the box that says "Restrict editing and printing of the document...".  Then provide a password.  This password can be provided if you wish to edit the document.  Check the "Enable copying of text...." checkbox, and set Printing Allowed to "High Resolution" and Changes Allowed to "Filling in form fields..."


Tuesday, July 26, 2016

Monday, June 13, 2016

Format a MS Word field for currency

Let's say you have a mail merge field in Word.  The data source that populates the field is simply a decimal value.  However, you want it to display with commas.  Use the following formatting switch to accomplish this:

\# "#,##0.00"

This is the original field.

Then, right click and select Toggle Field Codes.




Then, add the switch.





Wednesday, March 30, 2016

Web Services cannot find dll's in nested bin folders

When you create a new project and use a Class Library project type, the default configuration is to put the dll's in a folder named bin/release or bin/debug depending on your current build.  Then if you add a web service (either asmx or wcf), the web service will not be able to find the dll's because they are nested.  You must change the Project Properties, Compile tab, Build Output Path to just "/bin".

If you fail to do this, when you right click on the web service, and click View in Browser, you will get a parser error saying:  Could not create type.

This is a rare problem, because most of the time, you are creating a web project type that makes this configuration for you.

Friday, March 25, 2016

Visual Studio Solution Explorer Collapse All

When dealing with complex visual studio solutions with many projects, the solution explorer can become a mess of opened folders and files.  Solution Explorer remembers which folders you have opened, so if you're like me, you never go back and close the folders once you're done.  You just want to collapse the entire tree structure occasionally.  By default, you can collapse the current node of a tree by pressing the - sign on the number keypad.  But this only collapses the current node, and does not recursively close every sub folder.

This command does exist in Visual Studio, but it is not in the menu at least in the 2015 version that I have.  To use it, you have to assign a keyboard shortcut to it by going to the Tools menu and selecting Options, and then Keyboard like so:


Here I've set up a shortcut, so if I hold down CTRL while pressing CO, it will recursively collapse the current node in Solution Explorer.

UPDATE:  Don't use CTRL C as a starting sequence for your chord.  This will mess up the old standard CTRL C for Copy.  I ended up using CTRL O.

Friday, February 26, 2016

WCF Timeouts

Timeouts can be configured on either the client side or the server side.  They are set on the binding element in the web.config file.  See here for the specific details.

Client side timeouts are pretty self explanatory.  If you don't receive the response in the specified time period, the connection is closed and your code moves on.  Server side timeouts work a bit differently than I expected.  First of all, when you set a server side timeout, you are saying "After the connection is opened up, if I don't receive the full request in the specified amount of time, I'm going to time out."  What it is not saying is "If I receive the request and it takes me longer than the specified time to process the request, I time out."  You'll just keep churning away probably until your database connection times out.  I believe client side timeouts are set to a minute by default, but can be lengthened.

Thursday, February 25, 2016

Hosts file location

C:\Windows\System32\drivers\etc

This is where it is located in Windows 7.

Monday, February 1, 2016

Favorite Visual Studio Options

I recently upgraded to Visual Studio 2015, and had to set it up to my liking.  Since I only upgrade about every 2 years or so, I always forget where these settings are.  So, today, I'm going to make a note of these settings: