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

                                                                                                              • Consultant-Only Booking Page

                                                                                                                Zoho Bookings does not allow for Meeting Type OR Workspace-Wide booking pages to be turned off. This is detrimental to organizations that have territory-based or assigned accounts, because if prospects can go to these booking pages and either select the
                                                                                                              • Start Workflow from Deluge Script

                                                                                                                I have developed a customized process from our CRM that leverages a deluge script to create a statement of work document. Once the document has been created via the merge and store function, I would like the ability to start a workdrive review & approve
                                                                                                              • Request for Auto PO - Min–Max based Automated Purchase Feature

                                                                                                                Dear Zoho POS Team, I’m writing to request a feature enhancement that would significantly streamline inventory management for businesses using Zoho POS — particularly supermarkets, FMCG retail, and multi-store operations like ours. Feature Requested:
                                                                                                              • Masters in UK – Experiences, Universities, and Career Outcomes

                                                                                                                This forum discussion is for students who are planning or considering a Masters in UK and want to gain practical insights beyond official university websites. The UK attracts international students due to its globally recognized universities, diverse
                                                                                                              • Export your notes from Notebook!

                                                                                                                Dear users, The long awaited feature is now live. Yes, you can now export your notes from Notebook app in bulk. But the feature has just started with web app alone for now. You can try the export feature as mentioned below: Go to our web app, https://notebook.zoho.com Go to 'Settings' > 'Export' Now, select the format: You can select either ZNote or HTML Once done, you can use the same to import or can have this a local backup of your notes. Note: Export for other platforms are in development and
                                                                                                              • Prepopulating Fields

                                                                                                                Hello, I have a form (Assets) with 2 lookup fields: Client (from Clients) Site (from Client Sites) I modified the code (highlighted in red below), so the Site dropdown shows the list of sites related to the Client. must have Client_Site ( type = picklist
                                                                                                              • Unable to sort as Descending order

                                                                                                                Trying to change the sort order for a lookup field (checkboxes) from Ascending to Descending and keep getting an error in Deluge that the order must be Ascending Did anyone ran into this? Thanks Eyal
                                                                                                              • Export Invoices to XML file

                                                                                                                Namaste! ZOHO suite of Apps is awesome and we as Partner, would like to use and implement the app´s from the Financial suite like ZOHO Invoice, but, in Portugal, we can only use certified Invoice Software and for this reason, we need to develop/customize on top of ZOHO Invoice to create an XML file with specific information and after this, go to the government and certified the software. As soon as we have for example, ZOHO CRM integrated with ZOHO Invoice up and running, our business opportunities
                                                                                                              • Can I change the format of the buttons in the email templates?

                                                                                                                Hi all! We have been working hard trying to brand our email templates, and have some way to go yet. One of the things we can't seem to edit is the green ${Cases.CUSTOMER_PORTAL_BUTTON} button and the font of the View Ticket text. Is there any way of doing
                                                                                                              • issue with deluge script

                                                                                                                i used chat gpt to build this script and I am getting 2 errors which I cannot figure out how to fix: void monthly_sales_order_generation() { try { // ---------------- CONFIG ------------------- analytics_url_1 = "https://analytics.zoho.com/api/<workspaceID>/report/<reportID1>/data";
                                                                                                              • Introducing LinkedIn Apply Connect for Zoho Recruit

                                                                                                                Attract up to 3x more qualified candidates and hire more efficiently with LinkedIn Apply Connect. Let candidates fill-in job applications without any redirections, gain deeper insights with applicant highlights within Zoho Recruit, and keep candidates
                                                                                                              • Recruit paid support?

                                                                                                                Hi all, Could anyone who has paid support package advise if it provides value for money with regards to support response times? Exploring the idea as unfortunately when we have faced issues with Recruit it has been a 7+ day timescale from reporting to
                                                                                                              • Introducing Dedicated Modules for Plans, Addons, and Coupons in Zoho Billing

                                                                                                                We’ve enhanced the way you manage Plans, Addons, and Coupons in Zoho Billing. Previously, all three grouped together under Subscription Items. Now, each one has its own dedicated module, giving you a cleaner and more intuitive experience. This update
                                                                                                              • Ticket Status email

                                                                                                                Good day, This was discussed in the past, but it would be helpful if we could have the system assign a custom response to a status. We have various statuses for tickets, e.g. "closed due to no response", or "Pending Status", it would be helpful for the
                                                                                                              • Customer ticket creation via Microsoft Teams

                                                                                                                Hi all, I'm looking to see if someone could point me in the right direction. I'd love to make it so my customers/ end users can make tickets, see responses and respond within microsoft teams. As Admin and an Agent i've installed the zoho assist app within
                                                                                                              • Holidays

                                                                                                                Hi; For defining Holidays, you need to add logic to handle the year as well as the month & day. We need to be able to enter Holidays for the next year. I need to add a holiday for January 2, 2017, but I can't until January 1st, which is a Sunday and we
                                                                                                              • Can I use a Standalone CRM Function as the Callback URL For Async Export Data API?

                                                                                                                I am creating an export job using this API https://www.zoho.com/analytics/api/v2/bulk-api/export-data-async/create-export/view-id.html There is a "callbackUrl" key in the CONFIG object. I tried copying the URL for a standalone function in CRM which can
                                                                                                              • Future Orders - Due Date

                                                                                                                Hi In my role, I can receive tickets where the work required is requested months in advance. Using a Future Orders option, which I believe was setup under the On Hold status type, hides the Due Date, in all views/ticket etc. Whilst I understand the reasoning
                                                                                                              • Introducing Withdrawal Reasons for Offers

                                                                                                                We’re excited to introduce a new enhancement to the Offer module that brings more clarity and accountability to every withdrawn offer. The Withdrawal Reason update ensures that each withdrawal — manual or automatic — is backed by a clear explanation,
                                                                                                              • Zoho Creator customer portal users

                                                                                                                Hi, I'm in a Zoho One subscription with our company. I'm running a project now that involves creating a Zoho Creater application and using the Zoho Creator Customer Portal.  At most we need 25 customer portal users. In our Zoho One plan we only get 3
                                                                                                              • GPS tracking only or Check out facility

                                                                                                                Dear Team, Zoho CRM is quite robust CRM but till date i was waiting for the feature of having GPS tracking of Sales employees which is a common demand by all customers for thier field sales executives. We cover them by saying that CRM provides Checkin
                                                                                                              • HTML Tags added to Reports with Notes

                                                                                                                Recently Zoho added the ability to markup text within notes. That way, users can change font size, colors, etc. It's a great change. However, since the change, reports that include a column for "Note Content" are printing HTML tags within the report.
                                                                                                              • In App Auto Refresh/Update Features

                                                                                                                Hi,    I am trying to use Zoho Creator for Restaurant management. While using the android apps, I reliased the apps would not auto refresh if there is new entries i.e new kitchen order ticket (KOT) from other users.   The apps does received notification but would not auto refresh, users required to refresh the apps manually in order to see the new KOT in the apps.    I am wondering why this features is not implemented? Or is this feature being considered to be implemented in the future? With the
                                                                                                              • Appraisals on Employee Information Profile

                                                                                                                Is it possible to show completed appraisals on each employee's "Employee Information" page? I would presume at the bottom - similar to the "Related Lists" concept in Zoho CRM. Obviously view access would be limited to employee and appropriate other roles
                                                                                                              • AI Interview Insights: Turn Recorded Interviews into Quick Transcripts & Summaries

                                                                                                                Evaluating interviews shouldn’t require replaying long recordings or taking manual notes. With AI Interview Insights, you can now review complete transcripts and AI-generated summaries of your One-way (Recorded) interviews right inside Zoho Recruit. This
                                                                                                              • Kaizen #220: Actions API - Webhooks APIs - Part 2

                                                                                                                Hello all!! Welcome back to the follow-up Kaizen post of Kaizen #219: Actions API - Webhooks APIs - Part 1. In the previous week, we covered how to configure a basic Webhook and how to include Headers, Body, and URL Parameters using both the POST Webhook
                                                                                                              • Standard Payment Term is not pulled from account to quotation

                                                                                                                Hey Team There seems to be something off. I do have "Net 30" as my default payment term in Zoho Books for my customers. If, from the customer overview or quote section, I create a new Quotation, the payment terms field stays blank and doesn't get the
                                                                                                              • Canva Integration

                                                                                                                Hello! As many marketing departments are streamlining their teams, many have begun utilizing Canva for all design mockups and approvals prior to its integration into Marketing automation software. While Zoho Social has this integration already accomplished,
                                                                                                              • Manage your invoices from Bigin's mobile app (iOS)

                                                                                                                Hello everyone! We're happy to announce that users can now integrate Zoho Books with the latest version of Bigin's iOS app. Zoho Books can be integrated with Bigin only via the web application. Users can view the Zoho Books tab in the detail pages of
                                                                                                              • HubSpot CRM to Zoho Creator Integration

                                                                                                                I'm trying to create an integration between HubSpot CRM and Zoho Creator with HubSpot being the push source (if a contact is created or updated in HubSpot, it pushes the information to Zoho Creator). I have two questions: 1- Is it best to use Zoho Flow
                                                                                                              • Systematic SPF alignment issues with Zoho subdomains

                                                                                                                Analysis Period: August 19 - September 1, 2025 PROBLEM SUMMARY Multiple Zoho services are causing systematic SPF authentication failures in DMARC reports from major email providers (Google, Microsoft, Zoho). While emails are successfully delivered due
                                                                                                              • Accessibility controls and multilingual captcha authorization for Help Center users ​

                                                                                                                Hello everyone, As part of our ongoing effort to improve user experience, we are excited about the accessibility controls and predefined accessibility personas added in the Help Center, similar to what is already available in Zoho Desk. Help Center users
                                                                                                              • Gain control over record sharing with portal users through our new enhancement: criteria-based data exposure

                                                                                                                Dear Customers, We hope you're well! Portals is a self-service avenue through which your clients can access and manage their direct and related data in Zoho CRM. This empowers them to be more independent and enables them to experience a sense of transparency
                                                                                                              • Zoho Sign + Zoho CRM : la solution pour simplifier vos accords de vente

                                                                                                                La conclusion d’un contrat de vente nécessite de nombreuses étapes : préparation de documents, validations successives et collecte des signatures. Les équipes commerciales passent souvent par plusieurs cycles de collaboration et de révision, tout en assurant
                                                                                                              • Zoho Desk Limitations

                                                                                                                Good day, all, I would like to know whether others share my frustration with some of Zoho's limitations. Don't get me wrong, I like Desk (and I also have a subscription for Analytics), I have been with them for close to 10 years, and unfortunately, I
                                                                                                              • Item/service subtotal

                                                                                                                Just discovered & really pleased that we can drag to re-order the line items in Sales orders & Invoices, a very nice feature which doesn't seem to be documented? It would be nice to be able to insert a subtotal as a line item to complete this great feature
                                                                                                              • Converting Sales Order to Purchase Order

                                                                                                                Hi All, Firstly, this code works to convert a sales order(SO) to a purchase order (PO) via a button, however I am running into an issue when I convert the SO where the values from the line items are not pulled across from the SO to the PO. The ones in
                                                                                                              • how to Solve Conflict Invoices in Zoho POS

                                                                                                                Hello Team, I am facing a repeated issue in Zoho POS while saving a sale that contains service-based items. My products are intentionally created as Service (Non-Inventory) items because I do not want to track stock for them. However, every time I try
                                                                                                              • All new Address Field in Zoho CRM: maintain structured and accurate address inputs

                                                                                                                The address field will be available exclusively for IN DC users. We'll keep you updated on the DC-specific rollout soon. It's currently available for all new sign-ups and for existing Zoho CRM orgs which are in the Professional edition. Latest update
                                                                                                              • Copy, Paste, Highlighted text

                                                                                                                when i copy paste text it gets highlighted. Fix this.  WTF is with this black highlight ? Fix copy pasting. Some people pay for using this mail service. 
                                                                                                              • Next Page