Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Print Roll Formatted

    Scheduled Pinned Locked Moved Captive Portal
    15 Posts 8 Posters 4.7k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D
      dpa
      last edited by

      Looked into printing vouchers by roll. Dived into coding and the result is not bad.  :D

      v2_2_4prntscrn1.png
      v2_2_4prntscrn1.png_thumb
      v2_2_4prntscrn2.png
      v2_2_4prntscrn2.png_thumb
      prntscrn2.png
      prntscrn2.png_thumb

      1 Reply Last reply Reply Quote 0
      • D
        doktornotor Banned
        last edited by

        Looks somewhat like this reasonably intergrated: http://sourceforge.net/projects/vouchergen/

        Perhaps someone could finally submit some patches, instead of showing off some random screenshots of unknown code that gets lost again and never gets integrated. Sigh.

        1 Reply Last reply Reply Quote 0
        • D
          dpa
          last edited by

          @doktornotor:

          Looks somewhat like this reasonably intergrated: http://sourceforge.net/projects/vouchergen/

          Perhaps someone could finally submit some patches, instead of showing off some random screenshots of unknown code that gets lost again and never gets integrated. Sigh.

          I agree. But a client paid me to have this feature in their Pf, and sharing it here for free is somehow unethical for the client. At least not for now.

          I am posting this partly as an attempt to show to the Pf devs or whoever contributor to this great system, that this simple button to print the roll with proper format using few lines of CSS is very possible and simple - considering PHP is not my main job.

          Also I am posting this to show an alternative to the "voucher manager" or "voucher generator" systems, that other devs put great efforts on making(ie. the link you posted).

          I too hope that Pf Captive Portal will evolve into a fully featured Hotspot manager system like Unifi Controller or Tanaza does. Until then people will keep on showing few patches and get lost in the wind.

          1 Reply Last reply Reply Quote 0
          • jimpJ
            jimp Rebel Alliance Developer Netgate
            last edited by

            Those do look pretty good. I love the idea of having a means to print them out formatted, but the problem becomes a bit of a bikeshed formatting discussion when people want many different things (X labels per row/column, Y size labels, Z type of printer, etc). It quickly becomes a lot more complicated to code up a proper GUI.

            As for the client, on the one hand I can understand where they are coming from, but on the other hand it's an open source platform and it would be nice if something (code, hardware sales, etc) made its way back into the project since their business benefits from it.

            Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

            Need help fast? Netgate Global Support!

            Do not Chat/PM for help!

            1 Reply Last reply Reply Quote 0
            • D
              doktornotor Banned
              last edited by

              Well, the vouchergen thing linked above prints into PDF on itself, using fPDF. That doesn't work with unicode chars. So, I replaced that with tFPDF. What you mentioned is actually configurable via GUI (also paper formats, like the US letter vs A4 etc.), but…

              • the level of integration with pfSense is exactly zero (beyond importing of the voucher rolls).
              • the code is buggy like hell (I made only the very essential fixes to make it run on actually maitained PHP versions.)
              • all the comments are in German;
              • it uses MySQL as storage.

              Don't have time for that, certainly not unless someone produces a reasonable bounty. Plus, until the 2.3 code gets stabilized, it's just a waste of time.

              1 Reply Last reply Reply Quote 0
              • jimpJ
                jimp Rebel Alliance Developer Netgate
                last edited by

                Indeed. I'd rather see a CSS solution than PDF, but that's probably not as printer-friendly. Less overhead in terms of requirements to install, implementation size, etc.

                Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

                Need help fast? Netgate Global Support!

                Do not Chat/PM for help!

                1 Reply Last reply Reply Quote 0
                • D
                  doktornotor Banned
                  last edited by

                  Kinda convinced it could be shrinked into ~2 files, (one with some GUI code, one include), plus the tFTPD thing (which is basically one PHP class plus Dejavu fonts. All the authentication crap could go to /dev/null, there's also some Germany-only SMS nonsense bundled.

                  Still, nontrivial amount of work, and time consuming.

                  If someone wants to start a bounty - the primary prerequisite is that the code goes to pfSense itself, BSD-licensed. Definitely not another round of "client paid me to have this feature, look - it's nice…"

                  1 Reply Last reply Reply Quote 0
                  • E
                    eagle2
                    last edited by

                    @doktornotor:

                    Well, the vouchergen thing linked above prints into PDF on itself, using fPDF. That doesn't work with unicode chars. So, I replaced that with tFPDF. What you mentioned is actually configurable via GUI (also paper formats, like the US letter vs A4 etc.), but…

                    • the level of integration with pfSense is exactly zero (beyond importing of the voucher rolls).
                    • the code is buggy like hell (I made only the very essential fixes to make it run on actually maitained PHP versions.)
                    • all the comments are in German;
                    • it uses MySQL as storage.

                    Don't have time for that, certainly not unless someone produces a reasonable bounty. Plus, until the 2.3 code gets stabilized, it's just a waste of time.

                    Hi everyone,

                    I'm the guy who developed the vouchergen thing ;). I'm well aware of the current problems, and will fix at least some stuff since it seems to be somewhat popular in Germany (it was initially developed just for a single use case and I decided to share it afterwards…). Someone actually built something based on some code of my script which integrates into pfSense: http://sourceforge.net/projects/captiveportalplus/

                    Still not integrated as package or something, but probably closer than my "integration"...

                    1 Reply Last reply Reply Quote 0
                    • D
                      dpa
                      last edited by

                      it would be nice if something (code, hardware sales, etc) made its way back into the project since their business benefits from it.

                      Instructions:

                      Copy everything inside 2.2.4 or 2.0.3 folder to "/usr/local/www" of your PF. It will create a new folder "voucherfiles", and a new file " services_captiveportal_vouchers_print.php", and will also replace your "services_captiveportal_vouchers.php", so backup the original. Everything else is new, which can be deleted whenever you want.

                      Replace the background image to your company logo, or adjust table layout to whatever suits you.

                      cp_print_roll.zip

                      1 Reply Last reply Reply Quote 0
                      • K
                        kiwienka
                        last edited by

                        thanks dude it was exactly what i'm looking for, can i customize it little more :D :D

                        1 Reply Last reply Reply Quote 0
                        • I
                          Iahmad
                          last edited by

                          @dpa:

                          it would be nice if something (code, hardware sales, etc) made its way back into the project since their business benefits from it.

                          Instructions:

                          Copy everything inside 2.2.4 or 2.0.3 folder to "/usr/local/www" of your PF. It will create a new folder "voucherfiles", and a new file " services_captiveportal_vouchers_print.php", and will also replace your "services_captiveportal_vouchers.php", so backup the original. Everything else is new, which can be deleted whenever you want.

                          Replace the background image to your company logo, or adjust table layout to whatever suits you.

                          dear what about 2.2.6. same procedure for it.

                          1 Reply Last reply Reply Quote 0
                          • D
                            dpa
                            last edited by

                            @kiwienka:

                            thanks dude it was exactly what i'm looking for, can i customize it little more :D :D

                            Yeah you can customize it, it's only html/css.

                            I added color coding (different background images) based on number of minutes. You can change the settings-number of minutes in services_captiveportal_vouchers_print.php lines 121-156. See attached

                            2.2.4.zip

                            1 Reply Last reply Reply Quote 0
                            • D
                              dpa
                              last edited by

                              @ishtiaqaj:

                              @dpa:

                              it would be nice if something (code, hardware sales, etc) made its way back into the project since their business benefits from it.

                              Instructions:

                              Copy everything inside 2.2.4 or 2.0.3 folder to "/usr/local/www" of your PF. It will create a new folder "voucherfiles", and a new file " services_captiveportal_vouchers_print.php", and will also replace your "services_captiveportal_vouchers.php", so backup the original. Everything else is new, which can be deleted whenever you want.

                              Replace the background image to your company logo, or adjust table layout to whatever suits you.

                              dear what about 2.2.6. same procedure for it.

                              I have not looked into 2.2.6, some reported it isn't working on the latest release.

                              1 Reply Last reply Reply Quote 0
                              • D
                                DanieleIT
                                last edited by

                                Hi Dpa,
                                I'd like to let you know that I've just posted a roll print mod based on your code!
                                I've added some extra options, fixed some bugs, and rewrote all the HTML/CSS part using divs.

                                Here's the link to the post:
                                https://forum.pfsense.org/index.php?topic=108846.0

                                Let me know what do you think  :)

                                Daniele

                                1 Reply Last reply Reply Quote 0
                                • R
                                  redeyes
                                  last edited by

                                  Will it be possible for you to update "services_captiveportal_vouchers.php" to run smoothly with pfSense 2.3 ?

                                  1 Reply Last reply Reply Quote 0
                                  • First post
                                    Last post
                                  Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.