Results 1 to 7 of 7

Thread: Using FDF (or something else) to write to PDF form

  1. #1
    hadoob024's Avatar
    hadoob024 is offline Sugar Community Member
    Join Date
    Mar 2010
    Posts
    137

    Default Using FDF (or something else) to write to PDF form

    I tried doing some searches but couldn't find much. I basically have a PDF form. I need to be able to fill out the various form fields using values returned from a query that I run in Sugar. I have my query running properly, I just need to know how to actually write to this PDF form. I've used ezPDF stuff before, but that seems to write information using coordinates on a page. I need to be able to accurately write to a form field. Anyone done this before?

    I've seen something called FDF http://www.verypdf.com/pdfform/fdf.htm

    I've also seen http://www.pdfforsugar.com


    Anyone used any of these? Any other tips/suggestions? Thanks!
    -hadoob024-


    Windows 7 SP1
    PHP 5.2.17
    SQL Server 2008 R2
    IIS 7.5
    Sugar Professional Version 5.5.1

  2. #2
    hadoob024's Avatar
    hadoob024 is offline Sugar Community Member
    Join Date
    Mar 2010
    Posts
    137

    Default Re: Using FDF (or something else) to write to PDF form

    Just installed the PDFforSugar module. This tool is not going to accomplish what I need. It currently only gathers all the information to populate the PDF form from one record from one module. The PDF form that I need to populate from Sugar gets its information from several modules. I run a query that joins several modules and it’s from this resultset that I want to populate the PDF form. Oh well. Guess this tool is a no go and will have to figure out something else.

    Anyone else tried this?
    -hadoob024-


    Windows 7 SP1
    PHP 5.2.17
    SQL Server 2008 R2
    IIS 7.5
    Sugar Professional Version 5.5.1

  3. #3
    hadoob024's Avatar
    hadoob024 is offline Sugar Community Member
    Join Date
    Mar 2010
    Posts
    137

    Default Re: Using FDF (or something else) to write to PDF form

    Well. Finally figured this out. Pretty simple too. First of all, you'll need to go to:

    http://koivi.com/fill-pdf-form-fields/


    This tool is SUPER simple for populating the form fields of a PDF file with an array of whatever data you want. This tool, however, saves the file as a FDF file. You'll then need Pdftk tool from:

    http://www.pdflabs.com/docs/install-pdftk/


    This tool will then take your FDF file and convert it to PDF. So in your PHP code, all you need to call is something like:
    PHP Code:
    exec('pdftk My_Form.pdf fill_form YOUR_FDF_FILE.fdf output YOUR_PDF_FILE.pdf flatten'); 
    That's all there is to it.
    -hadoob024-


    Windows 7 SP1
    PHP 5.2.17
    SQL Server 2008 R2
    IIS 7.5
    Sugar Professional Version 5.5.1

  4. #4
    eitrix's Avatar
    eitrix is offline Sugar Community Member
    Join Date
    Aug 2010
    Location
    Serbia
    Posts
    396

    Default Re: Using FDF (or something else) to write to PDF form

    thx for sharing
    CRM Software Engineer
    Eontek - www.eontek.rs

  5. #5
    hadoob024's Avatar
    hadoob024 is offline Sugar Community Member
    Join Date
    Mar 2010
    Posts
    137

    Default Re: Using FDF (or something else) to write to PDF form

    No problem. Yeah, it took a little while to figure out but those two tools are both excellent resources for doing this. Hopefully it will save someone from the headache I got trying to figure it out
    -hadoob024-


    Windows 7 SP1
    PHP 5.2.17
    SQL Server 2008 R2
    IIS 7.5
    Sugar Professional Version 5.5.1

  6. #6
    evelkova is offline Junior Member
    Join Date
    Dec 2010
    Posts
    1

    Default Re: Using FDF (or something else) to write to PDF form

    Hey

    I am using the website mentioned above and the toolkit. I am able to generate the fdf files - no problem there. However, i am not able to generate the pdf file.
    Actually, how do you know that you have generated it?!?!

    I would greatly appreciate any help or suggestions with respect to this problem, as I really need to make this working...

    Thank you very much in advance!

  7. #7
    hadoob024's Avatar
    hadoob024 is offline Sugar Community Member
    Join Date
    Mar 2010
    Posts
    137

    Default Re: Using FDF (or something else) to write to PDF form

    Here's all I do:

    PHP Code:
    $fdf_file="CMS".$focus->caseid.".fdf";
    $pdf_file="CMS".$focus->caseid.".pdf";
    $fdf_dir=".\\pdfFiles\\";
    exec('pdftk cms1500.pdf fill_form '.$fdf_dir.$fdf_file.' output '.$fdf_dir.$pdf_file.' flatten');
    exec('del '.$fdf_dir.$fdf_file); 

    The only way I got it working was to make sure that my PDF form file, pdftk.exe and libiconv2.dll are in the same directory as the file calling these commands (which in my case is index.php in the root directory) and this works like a charm. Where do you have your files located?
    -hadoob024-


    Windows 7 SP1
    PHP 5.2.17
    SQL Server 2008 R2
    IIS 7.5
    Sugar Professional Version 5.5.1

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Opt out -- but I want to write to them?
    By EricEdmeades in forum Help
    Replies: 1
    Last Post: 2008-10-15, 04:15 PM
  2. Write Letter
    By richardccim in forum Help
    Replies: 0
    Last Post: 2008-10-11, 12:52 PM
  3. How to write on the Wiki
    By DragonflyMaster in forum SugarWiki Discussion Forum
    Replies: 5
    Last Post: 2008-04-02, 01:36 PM
  4. where to write?
    By raslam in forum Developer Help
    Replies: 2
    Last Post: 2007-11-29, 10:46 AM
  5. Cannot Write in Greek
    By dimitrisand in forum Help
    Replies: 3
    Last Post: 2005-10-07, 09:49 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •