Pdf from Txt: which language to choose ?

Discussion in 'Programming' started by gldigital, Dec 14, 2014.

  1. #1
    Hello,

    I need to create a pdf file using a txt file as the data source, coding some program/script that runs on Windows Os.

    What kind of skills should I look to post this job on sites like Odesk or Elance: some general programming like php or C or some specific pdf scripting skills ?

    Any help is much appreciated.
     
    gldigital, Dec 14, 2014 IP
  2. Anveto

    Anveto Well-Known Member

    Messages:
    697
    Likes Received:
    40
    Best Answers:
    19
    Trophy Points:
    195
    #2
    IF you want the program to run on windows and want something done at a reasoable price you will most likely want someone who knows C#
     
    Anveto, Dec 14, 2014 IP
  3. gldigital

    gldigital Active Member

    Messages:
    39
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    91
    #3
    Hi Markus, thank you for your answer.

    In reality, the program can even run on linux or a webhosting under linux with php or perl: the final choice will be based on pricing.

    The action to be performed are very simple and there will be only one option when running the script: txt file contains 10 fields of data on each line that should be copied on the pdf file.
     
    gldigital, Dec 14, 2014 IP
  4. sarahk

    sarahk iTamer Staff

    Messages:
    28,824
    Likes Received:
    4,539
    Best Answers:
    123
    Trophy Points:
    665
    #4
    Basic php skills are all that's needed. I use a thirdparty site called phptopdf.com - I gather they'll start charging soon so check that out
     
    sarahk, Dec 14, 2014 IP
  5. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #5
    Hm. Anyone know of any other toPDF-libraries available? The PHPtoPDF-thingy seems a bit... limited, and the code they provide in the examples are a bit abysmal, hence I'm not too keen. They also use an eval() in the API-PHP-file, which is turned off on my server, so it might not actually work (although it seems to be in a deprecated / legacy function). Meh, not a fan. Also, no built-in "to database" functionality (not too hard to code in yourself, but a bit of an oversight). Any others?
     
    PoPSiCLe, Dec 14, 2014 IP
  6. Anveto

    Anveto Well-Known Member

    Messages:
    697
    Likes Received:
    40
    Best Answers:
    19
    Trophy Points:
    195
    #6
    I have used http://www.tcpdf.org with great results in the past.

    Now as I have graphs and things which I need to export to a PDF I prefer using wkhtmltopdf.org which is basically like taking screenshot of your page via the server. What I do is that I generate specific pages that only the server has access to which will be exported to the pdf file for the user.
     
    Anveto, Dec 14, 2014 IP
    sarahk likes this.
  7. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #7
    The latter one seems good, but it's a bit of a hassle to have to create a separate on-server batch-file (or similar) - especially (I haven't really looked into using it yet, I might be mistaken) if server-setup might play into getting it to work properly. I'll have a look at it, though, it might do what I need :) Thanks for the suggestions!
     
    PoPSiCLe, Dec 14, 2014 IP
  8. gldigital

    gldigital Active Member

    Messages:
    39
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    91
    #8
    For the simple actions I need to perform on the txt dataset, probably a simple Vbs script is enough
     
    gldigital, Dec 15, 2014 IP
  9. sarahk

    sarahk iTamer Staff

    Messages:
    28,824
    Likes Received:
    4,539
    Best Answers:
    123
    Trophy Points:
    665
    #9
    tcpdf looks good and I like that the code is on the server and that you aren't relying on a third party.
    wkhtmltopdf is for personal use only and not something you can offer on your website for generating reports etc.
     
    sarahk, Dec 15, 2014 IP
  10. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #10
    Not really problematic to run wkhtmltopdf as a user-service, but that would mean you'd have to call some sort of background task running on the server (for instance, create a PDF-file on any update to a given folder (by means of people generating reports or updating information etc)).
     
    PoPSiCLe, Dec 15, 2014 IP
  11. Anveto

    Anveto Well-Known Member

    Messages:
    697
    Likes Received:
    40
    Best Answers:
    19
    Trophy Points:
    195
    #11
    Exactly, I used this to talk to wkhtmltopdf https://github.com/mikehaertl/phpwkhtmltopdf

    If a user wants a report I will call wkhtmltopdf via my php script which will generate the pdf file in a folder which I specify. I can then present a link to that pdf file so that the user may download it.
     
    Anveto, Dec 15, 2014 IP
  12. phantom

    phantom Well-Known Member

    Messages:
    1,509
    Likes Received:
    32
    Best Answers:
    0
    Trophy Points:
    140
    #12
    You know if its a one time thing for yourself there are firefox add-ons that will do it like Web2pdf and many others. Just view the text in the bowser then click a button to save as pdf no programming required.
     
    phantom, Dec 16, 2014 IP
  13. ablaye

    ablaye Well-Known Member

    Messages:
    4,024
    Likes Received:
    97
    Best Answers:
    0
    Trophy Points:
    150
    #13
    Java would be an option. You can write a Java application to do the job that you are asking.
     
    ablaye, Dec 21, 2014 IP
  14. Dagon

    Dagon Active Member

    Messages:
    122
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    60
    #14
    www.fpdf.org is really simple to use and will do the job...used it a lot for various projects. You can also find a few sample codes on their site, for example generating pdf invoices, tables and stuff like that.
     
    Dagon, Dec 22, 2014 IP