Designer PDF Forms for Zoho on you own server

Designer PDF Forms for Zoho on you own server

DESIGNER PDF FORMS FOR ZOHO
I thought I would share this because it took so much of my time to figure everything outI wanted forms that looked sexy and professional.  The export pdf function of Zoho was very limited as are most pdf export options of many programs.  Only high end expensive programs have options to really make fancy forms.  I liked the simplicity of Zoho in building forms but I wasn't happy with the output.  My programming object of the PDF form was simple.

1. Take Form data using Zoho
2. Send it to my own server and merge it with a designer pdf form
3. Use zoho to send the link or allow the client to print from their pdf viewer

Here is a step by step explanation on how you can do yours..there is a RESOURCE LIST at the bottom for easy access to the programs mentioned in the posting.

* Note the 6.65kb Zoho_Form_Processor.txt was replace because of a small error. For some reason I was not able to delete it.

THE PROCESS

The following is the step by step process for creating your own system.  You are provided with all of the necessary free and opensource software to create you own system.

Step #1

Use Inkscape (free www.inkscape.org) to create the form decoration. 



With this program you can create very sophisticated pdf backgrounds.  Most online documents and directly generated pdf documents from database or spreadsheets that are created by pdf generators are dull and not very attractive.

By using a inkscape you can create really attractive form backdrops that pdf files can use a the background.  When pdf's get to the point where it supports .svg then the these documents no longer need to be exported as bit map files which have a tendency to be large, but .svg as vector graphics will be small and a much higher viewing and printing resolution.

I created image below in about 10 minutes, exported it to the png format.  We will use this image next in to make our form. Inkscape has many special effects filters that you can download and use.  Look at the 2011.  This was done with a filter called "Bevel Steel", I just typed "2011" and selected the filter.  The LIONS CLUB REPORT (I had two II's i guess) was done with several processes using paths.  It is not so easy but once you master it (after an hour or so) you can do so many interesting things.








PROBLEMS FACED WITH OPENOFFICE INKSCAPE
  • Be careful not to use too high of a resolution as your pdf files will be too large.  Try using 200dpi or 120dpi.  Your forms will still look good.  If you need high printer quality then 300dpi is what you will require.  If this is the case then use .jpg compression.  The only bitmap export option is PNG so you should use GIMP 2.0 which is a free bitmap graphics program (free www.gimp.org).
  • When you make your picture backgrounds be sure to export in PNG.  Inkscape will automatically use white as the transparency.  If the white spaces are not transparent the form will be covered.
Step #2
Use Openoffice write (free www.openoffice.org) to create the pdf form.

In open office suite of programs we use write to build our form.  We load the background page made in inkscape as a backgroiund format>page>background>as>graphic. You then browse for the png file and load it as the page background.  You should remember to set margins to 0mm or there will be a white space around your form.  It is better not to have white space since most pdf viewers will print on the printable area making their own white space.  It also leaves less space for you to establish your form controls.

By the way, Openoffice can import PDF files edit them and save them again. Don't underestimate the power of FREE!



Turn on the dialog for creating forms and start by placing the form controls.  You have various options to have frames 3d or flat around the control fields.  Leave these on while you are designing your form fields.  Using the form field navigator located on the tool bar at the bottom of write you can select all of the fields and turn off the border.  I do this at the end so I can see where my fields are, otherwise you have to guess a little bit.  I like to turn off the border and prefer to use the borders on my inkscape background after I finish my editing.



Using the form builder you build your form keeping in mind how you are going to populate the fields with Zoho.  There are two kinds of form populating you have to consider. Single fields and repeating fields.  For repeating fields you have to name them in open office as IDNo1, IDNo2, IDNo3 etc.  Using your own variable names. 



Then in Zoho you simply use a for each to build the variables for your post you iterate through the values and load up the post variables.

post_vars=Map();
mRowNo=1;
for each mRow in myform[year == input.year]
{
    post_vars.put("IDNo"+mRowNo.tostring(),mRow.IDNo);
    post_vars.put("Days"+mRowNo.tostring(),mRow.Days_Attended);
    post_vars.put("Name"+mRowNo.tostring(),mRow.Name);
}

Look carefully at the code above. Not that we make IDNO tags like IDNO1, IDNO2 etc.  These are the same tags that we used in our form.  If you use IDNO01 then you need to use a Zoho sub routine to pad the number.  Keep it simple.

PROBLEMS FACED WITH OPENOFFICE WRITE
  • Make sure you get the stable version avoiding the beta versions as I have experienced problems with the form design.  It takes a little experimenting to get the forms right. 
  • Be careful of font size selection.
  • I have not experimented with any other control other than the simple field.  I use Zoho and my own functions to format the fields before I send them.
  • Dont worry about crashing.  OO (Openoffice) has a very good recovery routine.  Just remember to set your auto save to every 5 minutes. I experience crashes when I have too many applications running.  I am impatient and cause so many problems for my operating system.

Step #3
You must upload onto your server the pdftk.exe tool (free http://www.pdflabs.com/docs/install-pdftk/)

This program is a powerful utility that can do many things with PDF files.  Our interest is its ability to merge a FDF and PDF file with or without a background (picture image) then flatten it.

Read carefully the documentation, you will probably find many other things to help you like security and password protection.  These are easy to implement with ZOHO.

PROBLEMS FACED WITH PDFTK
  • I have lost countless hours because of small issues that I wasn't aware of.  Be sure that when you send data fields to the processor that you do not have unpaired brackets i.e. "(" must have ")".  The FDF will not be recognized by the PDF form.
  • Make sure that you have the right to run .exe files on your server and that where ever you instruct pdftk.exe to save files has the necessary permission. 
  • Some hosting providers don't allow you to execute programs.  Most will allow you if you ask them however.  The default is to block you!
Step #4
With the pdftk.exe file uploaded on your server you will need two PHP program scripts to take data from ZOHO create a FDF file then use pdftk.exe to merge and then create a new pdf file or print a pdf to the screen.

These programs were developed by others.  I just copied them and modified them to suite my needs.  You can find the original authors in the files.

Attachments
a)    Zoho_Form_Processor.txt
      must be uploaded to your server and renamed as a PHP file. 
      You can edit the program and change the CONFIGURATION content to suite your needs.
      Be careful if you modify it.  Always keep the original copy just in case...!
b)   createFDF.txt
      must be uploaded to your server as a PHP file. 
      This is the function that will be called from Zoho_Form_Processor.php
      to build the fdf file using post data received from  your Zoho Creator application.

PROBLEMS FACED WITH THE PHP programs

  • Any time you modify PHP programs expect headaches.  Small mistakes will render them useless. 
  • Use codelobster (free www.codelobster.com) to edit your PHP files and debug them.  You will need wampserver (free www.wampserver.org) to edit php programs. 
  • Unless you are somewhat experienced then don't modify the programs.  They are generic enough to do most of what you want to do.
Step #5
You now need to build a Zoho form application that will do the following.
a) Take form data and load a map variable
example:
post_vars=Map();
mRowNo=1;
for each mRow in myform[year == input.year]
{
    post_vars.put("IDNo"+mRowNo.tostring(),mRow.IDNo);
    post_vars.put("Days"+mRowNo.tostring(),mRow.Days_Attended);
    post_vars.put("Name"+mRowNo.tostring(),mRow.Name);
}

You can use what ever variable name you want.  I used post_vars just because it sounded good.

PROBLEMS FACED WITH THE ZOHO

  • Don't populate the MAP variable with one go using {"variable",value:"variable",value,"variable",value}.  For some reason I could not get it to work.  Do one by one.
These are the configuration variables you need to .put
variable            description
webname         The name of your website
                       example:    post_vars.put('webname',"My_Web_Site.com")
prog_dir           directory of pdftk.exe
                       if you leave it out the program will assume $dir_root=$_SERVER['DOCUMENT_ROOT']
nodatamsg       message if there is no data
                       default "No POST data detected!" if you leave it out
dir_root             root directory
                       default is $dir_root=$_SERVER['DOCUMENT_ROOT'] if you leave it out
fdf_dir               the directory where the form is
                       default $fdf_dir=dirname(__FILE__) if you leave it out
fdf_file               the name of the fdf file.. is the container for the pdf form data
                       default is $fdf_file='fdf_temp.fdf' if left out           
backgroundfile   the name of any background file which we will use to include pictures or watermarks for out pdfs
                        blank if you do not need it
pdf_doc             the name of your pdf from file
                        without this the program will terminate with error   
pdfoutput          the name you want to give to the output file
                        if left blank the output with go to standard devise which is print to screen
flatten               set to true in Zoho will cause the output file to be flattened (un editable)
                       the default if left is true set to false if you want editable output

KNOWN ISSUES AND PROBLEMS YOU CAN FACE
1) You web service provider doesn't allow programs like .exe to be executed on their server
2) Issues with folder access, make sure you set the read/write privileges for your .exe program
3) Basic mistakes in naming configuration variables
4) The PDF file must be able to receive data (FDF) output.


Step #6
Now you want to post your variables to your website and get the results back taking out the path and file name of the pdf document if you select document output v.s. screen.

mResult = postUrl("My_Web_Site.com/Zoho_Form_Processor.php", post_vars);
mURL = "http://" + (mResult.getSuffix("http://")).subString(0,((mResult.getSuffix("http://"))).lastIndexOf("<!DOCTYPE"));

Note: Green text indicates that you put your own names.


RESOURCE LIST
Inkscape vector graphic software download
Gimp 2.0 bitmap graphic software download
Openoffice free suite of applications for creating fdf type pdf forms
PDFTK utility tool to combine and flatten pdf file with fdf data
Codelobster PHP editing and debuggin program
Wampserver to allow PHP debugging on your system


































































































































    Access your files securely from anywhere







                            Zoho Developer Community




                                                  • Desk Community Learning Series


                                                  • Digest


                                                  • Functions


                                                  • Meetups


                                                  • Kbase


                                                  • Resources


                                                  • Glossary


                                                  • Desk Marketplace


                                                  • MVP Corner


                                                  • Word of the Day


                                                  • Ask the Experts





                                                            Manage your brands on social media



                                                                  Zoho TeamInbox Resources



                                                                      Zoho CRM Plus Resources

                                                                        Zoho Books Resources


                                                                          Zoho Subscriptions Resources

                                                                            Zoho Projects Resources


                                                                              Zoho Sprints Resources


                                                                                Qntrl Resources


                                                                                  Zoho Creator Resources



                                                                                      Zoho CRM Resources

                                                                                      • CRM Community Learning Series

                                                                                        CRM Community Learning Series


                                                                                      • Kaizen

                                                                                        Kaizen

                                                                                      • Functions

                                                                                        Functions

                                                                                      • Meetups

                                                                                        Meetups

                                                                                      • Kbase

                                                                                        Kbase

                                                                                      • Resources

                                                                                        Resources

                                                                                      • Digest

                                                                                        Digest

                                                                                      • CRM Marketplace

                                                                                        CRM Marketplace

                                                                                      • MVP Corner

                                                                                        MVP Corner







                                                                                          Design. Discuss. Deliver.

                                                                                          Create visually engaging stories with Zoho Show.

                                                                                          Get Started Now


                                                                                            Zoho Show Resources

                                                                                              Zoho Writer

                                                                                              Get Started. Write Away!

                                                                                              Writer is a powerful online word processor, designed for collaborative work.

                                                                                                Zoho CRM コンテンツ



                                                                                                  Nederlandse Hulpbronnen


                                                                                                      ご検討中の方




                                                                                                              • Recent Topics

                                                                                                              • sync views to sheet

                                                                                                                Im looking to sync my views aka reports in analytics to zoho sheets, when data is updated in analytics it also should be updated in sheets, till now zoho sheets only offer raw data connection and it is not enough as these reports are difficult to re-do
                                                                                                              • Is there an API to "File a Ticket" in Desk

                                                                                                                Hi, Is there an API to "File a Ticket" in Desk to zoho projects?
                                                                                                              • Keyboard UX for Assemblies

                                                                                                                The new Assembly module has a counter-intuitive behavior that ought to be corrected. When an Assembly is ready to be entered, there are two options given, the blue-highlighted "Assemble" and the gray "Save as Draft". This correctly implies that the normal
                                                                                                              • Mapping a new Ticket in Zoho Desk to an Account or Deal in Zoho CRM manually

                                                                                                                Is there any way for me to map an existing ticket in Zoho desk to an account or Deal within Zoho CRM? Sometimes people use different email to put in a ticket than the one that we have in the CRM, but it's still the same person. We would like to be able
                                                                                                              • Cliq iOS can't see shared screen

                                                                                                                Hello, I had this morning a video call with a colleague. She is using Cliq Desktop MacOS and wanted to share her screen with me. I'm on iPad. I noticed, while she shared her screen, I could only see her video, but not the shared screen... Does Cliq iOS is able to display shared screen, or is it somewhere else to be found ? Regards
                                                                                                              • How to Move Behavior, Acquisition, Polls & Forms Data from Zoho PageSense to Zoho Analytics?

                                                                                                                Hi Zoho Community, I'm looking for a way to transfer data from Zoho PageSense to Zoho Analytics, specifically: Behavioral data (clicks, scrolls, heatmaps, etc.) Acquisition data (traffic sources, campaigns, etc.) Polls and forms data As far as I can tell:
                                                                                                              • Why can't I see images uploaded by other users in the Library for Campaigns

                                                                                                                We are several users of zoho Campaign. I have uploaded visuals of our company, but my team members can't see them.
                                                                                                              • zoho sheet stuck

                                                                                                                I Need help. ZOHO sheets stuck on the loading screen. I've already deleted the system cache and cookies of my browser (google chrome) but it's still not opening. 
                                                                                                              • Tip of the Week #78 – Cut response time with multichannel shared inboxes

                                                                                                                If you’ve ever felt your team juggling between multiple email accounts, social pages, and chat apps just to reply to customers, you’re not alone. Managing conversations in multiple channels can quickly turn messy. Important messages across inboxes, replies
                                                                                                              • Need a way to run a client script longet than 10 seconds

                                                                                                                By The Grace of G-D. Hi, Currently, Client Scripts are Timing out at 10 seconds. We have complex logics that needs more time. Can you add a feature request to increase the timeout?
                                                                                                              • Exciting Updates to the Kiosk Studio Feature in Zoho CRM!

                                                                                                                Hello Everyone, We are here again with a series of new enhancements to Kiosk Studio, designed to elevate your experience and bring even greater efficiency to your business processes. These updates build upon our ongoing commitment to making Kiosk a powerful
                                                                                                              • FSM Improvement Idea - Show an Import button when there is no data

                                                                                                                I am setting up FSM for a client and I noticed that there is no option to import data, see screenshot below. Even when you click Create Contact there is only an option to Import from Zoho Invoice. It is only after you add at lease 1 record that the Import
                                                                                                              • Unable to Send Different Email Templates for Different Documents in Zoho Sign

                                                                                                                Hello Zoho Community, I am facing a limitation with Zoho Sign regarding email notifications sent to customers when a document is sent for signing. Currently, whenever I send any template/document for signing, the email notification that goes to the customer
                                                                                                              • Timeline Tracking Support for records updates via module import and bulk write api

                                                                                                                Note: This update is currently available in Early Access and will soon be rolled out across all data centers (DCs) and for all editions of Zoho CRM. The update will be available to all users within your organization, regardless of their profiles or roles.
                                                                                                              • UI Improvement - Ability to Collapse Flow

                                                                                                                The UI for Flow is generally pretty good. However, when multiple decision trees are used, the layout can get pretty convoluted and hard-to-follow (see one of my Flows below): In these cases, even the auto-arrange fails to make this something that a normal
                                                                                                              • Tasks Statuses

                                                                                                                Hi, The task status "Completed" is a final status which closes the task. We need to have a status "Cancelled". However, when the status is set to "Cancelled", the task prompt still has a blue button to Close Task. When the customer clicks that and closes
                                                                                                              • Add Lookup Field in Tasks Module

                                                                                                                Hello, I have a need to add a Lookup field in addition to the ones that are already there in the Tasks module. I've seen this thread and so understand that the reason lookup fields may not be part of it is that there are already links to the tables (
                                                                                                              • Create New Tasks Layout in CRM

                                                                                                                I am able to do this in Leads, Contacts, Meetings, Calls - every other module, but cannot create a new layout in tasks. I have the appropriate access but it's simply not appearing as an option. Only "Standard" option shows. Please help!
                                                                                                              • Whatsapp Connection Status still "Pending" after migration

                                                                                                                Hello, I migrated my WhatsApp API to Zoho from another provider a day ago. So far the connection status is still “Pending”. There is a problem? How long does it usually take?
                                                                                                              • Using IMAP configuration for shared email inboxes

                                                                                                                Our customer service team utilizes shared email boxes to allow multiple people to view and handle incoming customer requests. For example, the customer sends an email to info@xxxx.com and multiple people can view it and handle the request. How can I configure
                                                                                                              • Auto-sync field of lookup value

                                                                                                                This feature has been requested many times in the discussion Field of Lookup Announcement and this post aims to track it separately. At the moment the value of a 'field of lookup' is a snapshot but once the parent lookup field is updated the values diverge.
                                                                                                              • Zoho Recruit Subscription

                                                                                                                Hello Zoho Recruit Team, Good day! I would like to inquire about your recruitment subscription plans and would also like to verify the current subscription our company is enrolled in under Zoho Recruit. Thank you, and I look forward to your response.
                                                                                                              • Keyboard shortcut M key

                                                                                                                I'm trying to customize my keyboard shortcuts and assign the "m" key. But it says the key is already assigned. I've looked through all my shortcuts and can't see any assigned "m". When I select an email and press the M key, nothing happens. What is the
                                                                                                              • Is it possible to create a meeting in Zoho Crm which automatically creates a Google Meet link?

                                                                                                                We are using Google's own "Zoho CRM for Google" integration and also Zoho's "Google Apps Sync" tools, but none of them provide us with the ability to create a meeting in Zoho CRM that then adds a Google Meet link into the meeting. Is this something that
                                                                                                              • Ensure Consistent Service Delivery with Comprehensive Job Sheets

                                                                                                                We are elated to announce that one of the most requested features is now live: Job Sheets. They are customizable, reusable forms that serve as a checklist for the services that technicians need to carry out and as a tool for data collection. While on
                                                                                                              • Bill automation in Zoho Books

                                                                                                                Hi I am looking for 3rd-party options for bill automation in zoho which are economical and preferably have accurate scanning. What options do I have? Zoho's native scanning is a bit pricey
                                                                                                              • Automatic Portal invite

                                                                                                                We have numerous customers we move through a blueprint in deals, when they get to a certain point we need to give them portal access, how can this be done through deluge or a workflow? Latest Update (December 2025): The option to automate portal invitations
                                                                                                              • Marketer's Space: Why mobile optimization deserves a place in your email strategy

                                                                                                                Hello Marketers, Welcome back to Marketer's Space! Today, we'll talk about the importance of creating mobile-friendly email designs. While mobile phones were once used only to make phone calls, today they're used for almost everything, including texting,
                                                                                                              • Enhancements in Canvas

                                                                                                                Dear All, Greetings! Canvas lets you design the record details page to suit your brand or business preferences. We are glad to introduce the following enhancements to uplift your design experience. Reusable Components Style Presets Let's go! Reusable
                                                                                                              • Introducing Dark Mode / Light Mode : A New Look For Your CRM

                                                                                                                Hello Users, We are excited to announce a highly anticipated feature - the launch of Day, Night and Auto Mode implementation in Zoho CRM's NextGen user interface! This feature is designed to provide a visually appealing and comfortable experience for
                                                                                                              • ABN with Legal Entity Name

                                                                                                                Hi, How can I execute this? The ABN number is entered in Accounts Module and ideally, it should display or suggest the correct Legal Entity Name based on the ABN lookup. ex. Account Name: JPG Resources ABN Number: 65 067 761 871 Legal Entity Name: (auto
                                                                                                              • Zoho Cliq not working on airplanes

                                                                                                                Hi, My team and I have been having this constant issue of cliq not working when connected to an airplane's wifi. Is there a reason for this? We have tried on different Airlines and it doesn't work on any of them. We need assistance here since we are constantly
                                                                                                              • Unify Overlapping Functionalities Across Zoho Products

                                                                                                                Hi Zoho One Team, We would like to raise a concern about the current overlap of core functionalities across various Zoho applications. While Zoho offers a rich suite of tools, many applications include similar or identical features—such as shift management,
                                                                                                              • Detailed Account Reports - Add Running Balance

                                                                                                                When one clicks into an account from a report (say P/L or Balance Sheet), the default reports have the Debit, Credit, and then the Amount. The Amount column (last one) is duplicate information. It would be far better and fit more peoples' use cases if
                                                                                                              • Issue: Ticket Export Does Not Include Ticket Threads

                                                                                                                Dear Zoho Desk Support Team, I hope you’re doing well. I wanted to bring to your attention that the current ticket export feature in Zoho Desk does not seem to include the ticket threads or conversation history. When exporting tickets, only the summary
                                                                                                              • Pushover Notification Module

                                                                                                                Hello, it would be good if there would be a "Pushover" (https://pushover.net/) module besides the standard SMS module. Pushover is now very well known, especially in IT, and is becoming more and more popular. The biggest advantage are the customizable
                                                                                                              • Forward - no Ticket Number

                                                                                                                Hello, when I send an email to Zoho Desk via Reply or Reply All, the ticket number is in the subject line. But if I use forward then not. Is there an option to change this? We often forward e-mails and a reply to this will of course create a new ticket
                                                                                                              • Checkout: Adding Images

                                                                                                                Hello everyone, I’m trying to add a small GoGreen logo in the shipping section of the checkout to promote our sustainable shipping. While I can insert text without any issues, it seems that adding images is not supported in this area. Is there currently
                                                                                                              • Sortie de Zoho TABLE ??

                                                                                                                Bonjour, Depuis bientôt 2 ans l'application zoho table est sortie en dehors de l'UE ? Depuis un an elle est annoncée en Europe Mais en vrai, c'est pour quand exactement ??
                                                                                                              • [solved] #original_sender trick not working for us

                                                                                                                Hello community ! We really like DESK.. it's working like a charm for us but I have a request. Some users are sending emails personnaly to me (instead of using the support adress).. and I saw there was a possibilty to use : #original_sender {mail@mail.com}
                                                                                                              • Next Page