Jump to content

hadoob024

Members
  • Posts

    192
  • Joined

  • Last visited

Everything posted by hadoob024

  1. That's what I would recommend. I tried doing something similar to what you have (pdf in one directory, pdftk.exe in another directory, file executing in another directory), and I kept getting errors. Then I just dumped them all in the root, and it just worked. But from your example, do you have the exe and dll files in the same directory as the file that's calling the exec() function, because that's how it looks pathed out?
  2. Yup. That's probably it. Here's the link: http://www.pdflabs.com/docs/install-pdftk/
  3. Here's all I do: $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); I then 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?
  4. Which part are you stuck on?
  5. I'm having a problem with this step. Where do all my files need to be located in order to perform the exec() command properly? I can do it fine using the command line where all these files (i.e., pdftk.exe, libiconv2.dll, my PDF form, the generated FDF file, and resulting final PDF file) are in the same directory. Is that the key though? Even if I specify path names? Because I can't seem to get the exec() command to properly run. My PDF is not being generated. Any thoughts?
  6. 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: exec('pdftk My_Form.pdf fill_form YOUR_FDF_FILE.fdf output YOUR_PDF_FILE.pdf flatten'); That's all there is to it.
  7. OK. Making some headway with this. Just wondering though how to select a checkbox if I have one? For example, I have a checkbox for gender. How do I select a value? I've tried: $data['15'] = $gender; and $data['15'] = "checked"; and $data['15'] = "selected"; But none of them seem to work. Any thoughts?
  8. OK. Been playing around with this for a little bit (tried with some sample garbage data into the PDF). I had to modify some of the code from that file, so mine now looks like: require_once 'createFDF.php'; $data=array("patientName"=>"TESTING PATIENT NAME","18"=>"MY TEST ADDRESS"); $fdf_file=strtotime(date("Y-m-d H:i:s")).".fdf"; //$fdf_dir=dirname(__FILE__).'\fdf'; $fdf_dir="C:\\Users\\User1\\Desktop"; $pdf_doc="C:\\Users\\User1\\Desktop\\1500.pdf"; $fdf_data=createFDF($pdf_doc,$data); if($fp=fopen($fdf_dir.'\\'.$fdf_file,'w')){ fwrite($fp,$fdf_data,strlen($fdf_data)); echo $fdf_file,' written successfully.'; }else{ die('Unable to create file: '.$fdf_dir.'\\'.$fdf_file); } fclose($fp); This does seem to work, but I have two follow-ups: 1) This code ends up creating a FDF file, but I need a PDF. Is this possible? 2) When opening up the FDF file, I get the following message: "The file you are attempting to open contains comments or form data that are supposed to be placed on C:Users User1Desktop1500.pdf. This document cannot be found. It may have been moved, or deleted. Would you like to browse to attempt to locate this document?" Any thoughts on these issues?
  9. Wow! Cool! Just downloaded the zip. OK. So it looks like the only file I need out of this zip file in order to implement the code you have is that "createFDF.php", correct? Will prob run through the tutorial they have on that site. Thanks again! Will let you know if I run into any issues. Quick follow-up. Just opened the "createFDF.php" file. Looks like there are some weird characters in there. What should this line actually read (my PHP editor is having some issues with some special characters): $data="%FDF-1.2\n%????\n1 0 obj\n<< \n/FDF << /Fields [ "; What should those "?" symbols read? I don't think that they're supposed to be questions marks. Just looked at the source file on their website, and even it looks weird: $data="%FDF-1.2\n%����\n1 0 obj\n<< \n/FDF << /Fields [ ";
  10. Quick follow-up. I went and downloaded the Acrobat Forms Data Format (FDF) Toolkit for Windows from http://www.adobe.com/devnet/acrobat/fdftoolkit.html. Where are the files that I need in order to add this functionality for PHP? I went through the whole zip file but can't seem to find any PHP files in it (especially createFDF.php or any other PHP files). Not sure where to go from here.
  11. Really? It's that simple??? So basically, I have to build out my MASSIVE array that links up the form fields in my PDF with the values returned by my query? So basically just go to http://www.adobe.com/devnet/acrobat/fdftoolkit.html, download the toolkit, copy it over to the server, and I should be up and running? Cool. Thanks man! Have you used this before? Any caveats I should be aware of?
  12. 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 SugarCRM. 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 hard-coded 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 This one is closer to what I'm looking to do, but it's 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. Any other tips/suggestions? Thanks!
  13. Sorry. Should've clarified better. For issue #1, I meant something closer to second comment you made: Except that we'll allow ratings of any product. It's just that if a company wants to post our ratings on their site (for marketing/bragging purposes), they must pay to do so. For issue #2, I meant more fraud protection. If Company A's product is rated lowly by our users, how can we stop them from hiring someone (or some company) to make fraudulent ratings to boost the overall image of their product? Hope that answered your questions (although I'm still recovering from the weekend so who knows )
  14. I just joined this startup venture. It's basically a company that's trying to create a general ratings system for products (similar to Amazon, Epinions, etc.). You see a product online, highlight it, right-click and then you can rate the product or search on the product's ratings. They then plan on charging sites to display these ratings (among other revenue avenues). The two issues I can see are: 1) How to make sure that ratings posted on a website are paid for by the website? 2) How to prevent marketing firms from posting fraudulent ratings for hire? For the second problem, I was thinking of tying the ratings to IP addresses, maybe? Or maybe the MAC address instead? Anyone have any thoughts on either of these two issues?
  15. Perfect!!! That worked. My final query (which works) is: SELECT ic.id,ic.name,ic.carrieraddress,ic.carriercity,ic.carrierstate,count(ipp.id) FROM carrier ic, patient_procedure ipp WHERE ic.deleted=0 AND ic.id = ipp.carrier_id GROUP BY ic.id ORDER BY ic.name;
  16. Here's the query: SELECT ic.id,ic.name,ic.carrieraddress,ic.carriercity,ic.carrierstate,ipp.id FROM carrier ic, patient_procedure ipp WHERE ic.deleted=0 AND ic.id = ipp.carrier_id ORDER BY ic.name; Spits out the result set: ID NAME CARRIERADDRESS CARRIERSTATE CARRIERCITY PATIENT_PROCEDURE ID 123 BCBS 999 main st. TX Dallas 123 123 BCBS 999 main st. TX Dallas 234 123 BCBS 999 main st. TX Dallas 345 123 BCBS 999 main st. TX Dallas 456 234 Cigna 123 main st. AZ Phoenix 345 234 Cigna 123 main st. AZ Phoenix 456 234 Cigna 123 main st. AZ Phoenix 567 234 Cigna 123 main st. AZ Phoenix 678 . . . But I need a result set like the following: ID NAME CARRIERADDRESS CARRIERSTATE CARRIERCITY count of patient_procedures 123 BCBS 999 main st. TX Dallas 5 234 Cigna 123 main st. AZ Phoenix 4 . . .
  17. Nope. No error message. It's just that the result set is not what I was looking for. I want my result set to look like: ID NAME CARRIERADDRESS CARRIERSTATE CARRIERCITY count of patient_procedures 123 BCBS 999 main st. TX Dallas 15 234 Cigna 123 main st. AZ Phoenix 31 . . . And so on.
  18. Oops. My bad. I forgot that one. Here it is updated: CARRIER: id name carrieraddress carriercity carrierstate deleted PATIENT_PROCEDURE: id name carrier_id
  19. Huh? Sorry. I don't get what you're asking. Here's the table structure though for both tables: CARRIER: id name carrieraddress carriercity carrierstate PATIENT_PROCEDURE: id name carrier_id So I need a list of every carrier along with a count of how many patient_procedure records have that particular carrier_id.
  20. I'm having problems writing this one particular query. I have two tables, CARRIER and PATIENTS. There's a one-to-many relationship between the two. Basically, in one query, I want to pull the CARRIERNAME and CARRIERADDRESS of every CARRIER record in addition to a count of how many PATIENTS records have that particular CARRIERID. Does that make sense? So far I've tried: SELECT ic.id,ic.name,ic.carrieraddress,ic.carriercity,ic.carrierstate,ipp.id FROM carrier ic, patient_procedure ipp WHERE ic.deleted=0 AND ic.id = ipp.carrier_id ORDER BY ic.name; Which doesn't work, and: SELECT ic.id,ic.name,ic.carrieraddress,ic.carriercity,ic.carrierstate,count(ipp.id) FROM carrier ic, patient_procedure ipp WHERE ic.deleted=0 AND ic.id = ipp.carrier_id ORDER BY ic.name; Which also doesn't work. Any thoughts on where I'm going wrong? Thanks!
  21. AAAaaahhhhhh.... <light bulb turning on> got it. Thanks a ton! Makes more sense now.
  22. I just came across this query and am not sure what's going on in this particular section of the SQL statement. I've never seen "if" statements in a SQL query. Tried googling this, but no example that I found matched what I was looking for. Here's the relevant part of the query. select mfg.name as mfgname,ap.manufacturer_id,ap.po_id,mfg.req_facacct as ReqAcctNum,ifm.mfg_acct_num as FacNum,mfg.acctnumber, if(fac.dtmcontract = 1 and ap.pay_facility = 0 and ap.facility_orders <> 'FacReorder','M', if(fac.dtmcontract = 1 and ap.pay_facility = 0 and ap.facility_orders = 'FacReorder' and ap.inventorytype = 'Rep Delivery','M', if(fac.dtmcontract = 0 and mfg.direct_bill = 1 and (ap.inventorytype = 'Rep Delivery' or ap.inventorytype = 'Drop Ship'),'M', if(fac.dtmcontract = 0 and mfg.direct_bill = 1 and (ap.inventorytype = 'Purchased' or ap.inventorytype = 'Consigned'),'C', if(fac.dtmcontract = 1 and ap.pay_facility = 0 and ap.facility_orders = 'FacReorder' and ap.inventorytype <> 'Rep Delivery','Z','C'))))) as potype from actparts ap . . .
  23. Cool. Thanks a ton for the tips! Yeah, I queried the db and it seems like the only bad characters right now are extraneous newlines and carriage returns. Instead of editing those records they just want me to "make it work" for display purposes. And I think they're putting something in place to clean/format the data entry for the future. Hopefully.
  24. Aaaahhh. Got it. Then it doesn't matter what kind of bad data has been entered, correct?
  25. Not sure exactly. The problem is that they shouldn't have any, and there's no limit to how many there might be, or what other bad data might be contained in addition to these extraneous newlines and carriage returns. Bad data was entered into the system, and that's what I'm responsible for cleaning up on displaying it. There shouldn't be any carriage returns or newlines, but no one screened data entry
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.