|
|
PDF FormsFrom $1Table of contentsNo headers
PDF Forms is actually a little misnomer. It refers to Synapse's (R213B3+) ability to take any one page document and turn that into a Synapse form which can be filled, or prefilled, and then printed - either the data alone, or the form with the data. An example would be the CMS-1500 claim form which can be pre-populated with the default values, and allowing you to type in the other fields necessary to make the claim. It is called PDF Forms because you will likely get the best results from starting with a PDF. However, you can also turn a MS Word document into a form. There are four basic steps involved:
To turn the document into a PNG file, we can install a program that does this for us. I have used successfully PDF to DXF JPG TIFF Converter 1.3 on the one occasion I tried it. Other programs I have tried with printer drivers that turned the printout into an image, but I found that the text was not clear enough in the PNG produced. To turn a PDF into EPS format, you can simply use GSView which has that as one of its options. If the original file is not PDF, then you are more limited. I used my printer driver for my Lexmark C510 color postscript printer which has an option to generate an EPS file. You might also want to try Adobe's official postscript driver for Windows. The next few steps are quite complicated and so I will walk you thru the process with creating a PDF Form. The files I created and used are attached to this page. For the purposes of this tutorial, I am going to use a PDF that is the application form to apply for the use of Adalimumab, or Humira, in the treatment of rheumatoid arthritis. Download this file to your PC. I did use PDF to DXF JPG TIFF Converter 1.3 on this file, but on this particular PDF, it turns all the little boxes into *. However, this does not matter as we will mask them all out with our widgets. Download this PNG to the same directory where you have synapse.exe I created the EPS file by printing to the Lexmark C510 and setting the output options to EPS. Download this EPS to the same directory as the PNG. Now we are going to create the form record. Navigate to Settings/Forms/PDF Forms, and click on the [Details] tab. Now fill in the bottom of the form as follows:
and click on the [Add New] button. A message should pop up that you have added the form successfully. However, a current limitation is that you won't see the new form until you restart Synapse. When you restart Synapse, you should now see that the navigation tree now looks like this:
and if you now click on the "Humira" leaf, the "Image" tab now shows the sa0812.png file as below.
We now need to determine the top left and bottom right coordinates on our PNG. Switch to the "Layout" tab, and click on the [Setup] button. This gives us some approximate coordinates, but we will change these to the following which we found by a little trial and error.
pagesize letter Now, click on the [Render] button and you will see that a little check widget appears over the "A" in the word "APPLICANT" at the top left of the image and a little check appears over the bottom right corner over the "1" of the fax number. We need to transfer these coordinates to the Native Offsets fields. Now with the image rendered, click on the [Dump] button, and copy the coordinate pairs to the PNG Image fields.
check at 44x108 Now we have little idea of what the EPS coordinate are, but we shall start with some defaults. Use these values 38x729 for EPS top left and 602x69 for EPS bottom right. Switch back to the "Layout" tab, and click on [Render], and then the [Print Form and Content] button. If GSView is installed, we should now see the template.ps file in the www directory viewed in GSView. We can see that the top left X appears over the "Address" word and the bottom right X a couple of cms to the right and above the "1" of the fax number. We now use a text editor to edit the www/template.ps file, and we want to change this part newpath 38.0 729.0 moveto (X) show so that the X is over the same areas as in the PNG. We can experiment and save the template.ps file, and GSView will show us the new preview. And after some experimenation, we find that
newpath 26.0 768.0 moveto (X) show gives us the X in the correct places ( note that postscript uses bottom left as 0x0, whereas the other coordinates we are using are 0x0 for top left ). We can now save 26x768 and 552x36 in the EPS image fields and click on the [Update Layout & Coordinates] button to save them. Our Details tab should now look like this
With all our coordinates correctly working, any widget we draw to the PNG should now appear in the same place on the postscript file. And our final code in the layout that places all the defaults and checkboxes over the PNG is as follow: pagesize letter Now, if you have managed to follow this tutorial correctly, then with this layout code, click on the [Render] button, and all the widgets should appear in their correct places as well as the default text. Click on [Print Form & Content] should invoke GSView on the generated PS file and show you a representation of the original form with our data overlaid. The other buttons - [Print Form Only] does that with no patient data, [Pre-printed Form] only shows our data, and [PDF Editor] turns the postscript file into a PDF, and invokes your default PDF program which may allow you to "ink" over the PDF.
Tags:
|