Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. The weird issues and workarounds we sometimes have to deal with

The weird issues and workarounds we sometimes have to deal with

Scheduled Pinned Locked Moved The Lounge
toolscsharpjavascripthtmlasp-net
17 Posts 10 Posters 0 Views 1 Watching
  • 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.
  • J Jacquers

    The task I have is pretty basic: Generate a PDF label with some barcodes. To get there is a bit of a mission though, mostly due to the availability (or lack of) tools. I create an html template and have wkhtmltopdf convert it to pdf. Easy enough, but having precise layout and positioning in html isn't always that easy. Generating code39 and 128 barcodes is relatively easy with JsBarcode. Except when it doesn't want to display once converted to pdf. Then you find out you have to set both the script and html to utf-8 encoding and then it works. Generating a 2D pdf417 type barcode is relatively easy with a javascript library, except it fails to display once converted to pdf by wkhtmltopdf. So I find a .Net Core library that can generate the barcode as a png, convert the bytes to a base64 image and use that in the html by replacing placeholder text. Another hurdle was wkhtmltopdf suddenly becoming very slow after being pretty fast in the past. Finally tracked down the issue to spoolsvc and my default printer being a network printer that's not connected anymore. Once removed the conversion works at a decent speed again. In short, what should be an easy task had lots of complications and workarounds, some quite weird and difficult to track down, but in the end I learned some interesting things :)

    J Offline
    J Offline
    Jorgen Andersson
    wrote on last edited by
    #2

    Then add all the fun you can have with Zebra label printers. X|

    Wrong is evil and must be defeated. - Jeff Ello Never stop dreaming - Freddie Kruger

    OriginalGriffO J R K 4 Replies Last reply
    0
    • J Jorgen Andersson

      Then add all the fun you can have with Zebra label printers. X|

      Wrong is evil and must be defeated. - Jeff Ello Never stop dreaming - Freddie Kruger

      OriginalGriffO Offline
      OriginalGriffO Offline
      OriginalGriff
      wrote on last edited by
      #3

      That's why I use Avery label sheets and run 'em through my laser printer.

      "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!

      "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
      "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

      J 1 Reply Last reply
      0
      • J Jorgen Andersson

        Then add all the fun you can have with Zebra label printers. X|

        Wrong is evil and must be defeated. - Jeff Ello Never stop dreaming - Freddie Kruger

        J Offline
        J Offline
        Jacquers
        wrote on last edited by
        #4

        I haven't had to deal with those too much. I've had to work with the Intermec label printers (with the label done in Crystal Reports), but it wasn't too bad.

        J 1 Reply Last reply
        0
        • J Jacquers

          The task I have is pretty basic: Generate a PDF label with some barcodes. To get there is a bit of a mission though, mostly due to the availability (or lack of) tools. I create an html template and have wkhtmltopdf convert it to pdf. Easy enough, but having precise layout and positioning in html isn't always that easy. Generating code39 and 128 barcodes is relatively easy with JsBarcode. Except when it doesn't want to display once converted to pdf. Then you find out you have to set both the script and html to utf-8 encoding and then it works. Generating a 2D pdf417 type barcode is relatively easy with a javascript library, except it fails to display once converted to pdf by wkhtmltopdf. So I find a .Net Core library that can generate the barcode as a png, convert the bytes to a base64 image and use that in the html by replacing placeholder text. Another hurdle was wkhtmltopdf suddenly becoming very slow after being pretty fast in the past. Finally tracked down the issue to spoolsvc and my default printer being a network printer that's not connected anymore. Once removed the conversion works at a decent speed again. In short, what should be an easy task had lots of complications and workarounds, some quite weird and difficult to track down, but in the end I learned some interesting things :)

          S Offline
          S Offline
          Slacker007
          wrote on last edited by
          #5

          the paragraph would be so much easier to read, if you split it after every 3-4 lines/sentences. Just a suggestion. :)

          J 1 Reply Last reply
          0
          • S Slacker007

            the paragraph would be so much easier to read, if you split it after every 3-4 lines/sentences. Just a suggestion. :)

            J Offline
            J Offline
            Jacquers
            wrote on last edited by
            #6

            Done :)

            S 1 Reply Last reply
            0
            • J Jacquers

              Done :)

              S Offline
              S Offline
              Slacker007
              wrote on last edited by
              #7

              Thank you. I was going to delete my post because I realized how much of a jerk I sounded after re-reading it. I will edit the OP to be more civilized. :-O

              J 1 Reply Last reply
              0
              • S Slacker007

                Thank you. I was going to delete my post because I realized how much of a jerk I sounded after re-reading it. I will edit the OP to be more civilized. :-O

                J Offline
                J Offline
                Jacquers
                wrote on last edited by
                #8

                I was thinking I should split it up while I was writing it :-O

                1 Reply Last reply
                0
                • J Jacquers

                  The task I have is pretty basic: Generate a PDF label with some barcodes. To get there is a bit of a mission though, mostly due to the availability (or lack of) tools. I create an html template and have wkhtmltopdf convert it to pdf. Easy enough, but having precise layout and positioning in html isn't always that easy. Generating code39 and 128 barcodes is relatively easy with JsBarcode. Except when it doesn't want to display once converted to pdf. Then you find out you have to set both the script and html to utf-8 encoding and then it works. Generating a 2D pdf417 type barcode is relatively easy with a javascript library, except it fails to display once converted to pdf by wkhtmltopdf. So I find a .Net Core library that can generate the barcode as a png, convert the bytes to a base64 image and use that in the html by replacing placeholder text. Another hurdle was wkhtmltopdf suddenly becoming very slow after being pretty fast in the past. Finally tracked down the issue to spoolsvc and my default printer being a network printer that's not connected anymore. Once removed the conversion works at a decent speed again. In short, what should be an easy task had lots of complications and workarounds, some quite weird and difficult to track down, but in the end I learned some interesting things :)

                  Sander RosselS Offline
                  Sander RosselS Offline
                  Sander Rossel
                  wrote on last edited by
                  #9

                  As soon as someone mentions PDF I start to panic X| For a standard it's incredibly difficult and tooling is sparse or expensive. Recently went the wkhtmltopdf route too.

                  Best, Sander Azure DevOps Succinctly (free eBook) Azure Serverless Succinctly (free eBook) Migrating Apps to the Cloud with Azure arrgh.js - Bringing LINQ to JavaScript

                  J 1 Reply Last reply
                  0
                  • J Jacquers

                    The task I have is pretty basic: Generate a PDF label with some barcodes. To get there is a bit of a mission though, mostly due to the availability (or lack of) tools. I create an html template and have wkhtmltopdf convert it to pdf. Easy enough, but having precise layout and positioning in html isn't always that easy. Generating code39 and 128 barcodes is relatively easy with JsBarcode. Except when it doesn't want to display once converted to pdf. Then you find out you have to set both the script and html to utf-8 encoding and then it works. Generating a 2D pdf417 type barcode is relatively easy with a javascript library, except it fails to display once converted to pdf by wkhtmltopdf. So I find a .Net Core library that can generate the barcode as a png, convert the bytes to a base64 image and use that in the html by replacing placeholder text. Another hurdle was wkhtmltopdf suddenly becoming very slow after being pretty fast in the past. Finally tracked down the issue to spoolsvc and my default printer being a network printer that's not connected anymore. Once removed the conversion works at a decent speed again. In short, what should be an easy task had lots of complications and workarounds, some quite weird and difficult to track down, but in the end I learned some interesting things :)

                    F Offline
                    F Offline
                    Fueled By Decaff
                    wrote on last edited by
                    #10

                    I tend to use a barcode font when I want to generate a barcode. It means that I need to calculate the checksum, but that is easy to do. The only issue is the lack of control of the barcode height. When using Windows I use Bullzip to print to PDF, or Windows 10 has a built-in print to PDF option. The only issue is using WMI to select the printer (and filename.) I guess in your case you would also have to specify the page size. Putting it all together to make a report - now that is where it gets... interesting. Good work in getting everything working.

                    1 Reply Last reply
                    0
                    • J Jacquers

                      I haven't had to deal with those too much. I've had to work with the Intermec label printers (with the label done in Crystal Reports), but it wasn't too bad.

                      J Offline
                      J Offline
                      Jorgen Andersson
                      wrote on last edited by
                      #11

                      When you're handling Crystal reports everything else is great.

                      Wrong is evil and must be defeated. - Jeff Ello Never stop dreaming - Freddie Kruger

                      1 Reply Last reply
                      0
                      • OriginalGriffO OriginalGriff

                        That's why I use Avery label sheets and run 'em through my laser printer.

                        "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!

                        J Offline
                        J Offline
                        Jorgen Andersson
                        wrote on last edited by
                        #12

                        Well, for manual work that's better, but if you want to automate a bit it's not so fun any more.

                        Wrong is evil and must be defeated. - Jeff Ello Never stop dreaming - Freddie Kruger

                        1 Reply Last reply
                        0
                        • Sander RosselS Sander Rossel

                          As soon as someone mentions PDF I start to panic X| For a standard it's incredibly difficult and tooling is sparse or expensive. Recently went the wkhtmltopdf route too.

                          Best, Sander Azure DevOps Succinctly (free eBook) Azure Serverless Succinctly (free eBook) Migrating Apps to the Cloud with Azure arrgh.js - Bringing LINQ to JavaScript

                          J Offline
                          J Offline
                          Jacquers
                          wrote on last edited by
                          #13

                          My condolences ;P It has quite a number of 'quirks'.

                          1 Reply Last reply
                          0
                          • J Jorgen Andersson

                            Then add all the fun you can have with Zebra label printers. X|

                            Wrong is evil and must be defeated. - Jeff Ello Never stop dreaming - Freddie Kruger

                            R Offline
                            R Offline
                            Rob_P
                            wrote on last edited by
                            #14

                            Double fun when using Clipper!

                            1 Reply Last reply
                            0
                            • J Jacquers

                              The task I have is pretty basic: Generate a PDF label with some barcodes. To get there is a bit of a mission though, mostly due to the availability (or lack of) tools. I create an html template and have wkhtmltopdf convert it to pdf. Easy enough, but having precise layout and positioning in html isn't always that easy. Generating code39 and 128 barcodes is relatively easy with JsBarcode. Except when it doesn't want to display once converted to pdf. Then you find out you have to set both the script and html to utf-8 encoding and then it works. Generating a 2D pdf417 type barcode is relatively easy with a javascript library, except it fails to display once converted to pdf by wkhtmltopdf. So I find a .Net Core library that can generate the barcode as a png, convert the bytes to a base64 image and use that in the html by replacing placeholder text. Another hurdle was wkhtmltopdf suddenly becoming very slow after being pretty fast in the past. Finally tracked down the issue to spoolsvc and my default printer being a network printer that's not connected anymore. Once removed the conversion works at a decent speed again. In short, what should be an easy task had lots of complications and workarounds, some quite weird and difficult to track down, but in the end I learned some interesting things :)

                              B Offline
                              B Offline
                              Bruce Patin
                              wrote on last edited by
                              #15

                              Everything presumably simple task I do seems to be that way.

                              1 Reply Last reply
                              0
                              • J Jorgen Andersson

                                Then add all the fun you can have with Zebra label printers. X|

                                Wrong is evil and must be defeated. - Jeff Ello Never stop dreaming - Freddie Kruger

                                K Offline
                                K Offline
                                Kirk 10389821
                                wrote on last edited by
                                #16

                                Okay, so we printed labels to go on Damaged Vehicles being kept outside. They were rubberized and considered "weather-proof"... (Are you guessing how this ends?)... Turns out, I never bothered to check the operating temperature of the adhesive (okay, I did, but since it was 10 below Freezing, I thought we were fine). Windchill can get much colder. so, on a windy morning, we go outside to see about 1,000 Labels flying around, and bunching on the ground and the near the fence. Panic Sets in... At this point, the conversation the other day (When we put the label on, should we remove the GREASE PEN marker of the Lot #) came to mind, and one was GREATFUL that we decided to leave it on, just in case. At this point, we revert to PAPER labels with aggressive adhesive and a larger, more forgiving barcode font. Oh, don't make me think of labels...

                                1 Reply Last reply
                                0
                                • J Jacquers

                                  The task I have is pretty basic: Generate a PDF label with some barcodes. To get there is a bit of a mission though, mostly due to the availability (or lack of) tools. I create an html template and have wkhtmltopdf convert it to pdf. Easy enough, but having precise layout and positioning in html isn't always that easy. Generating code39 and 128 barcodes is relatively easy with JsBarcode. Except when it doesn't want to display once converted to pdf. Then you find out you have to set both the script and html to utf-8 encoding and then it works. Generating a 2D pdf417 type barcode is relatively easy with a javascript library, except it fails to display once converted to pdf by wkhtmltopdf. So I find a .Net Core library that can generate the barcode as a png, convert the bytes to a base64 image and use that in the html by replacing placeholder text. Another hurdle was wkhtmltopdf suddenly becoming very slow after being pretty fast in the past. Finally tracked down the issue to spoolsvc and my default printer being a network printer that's not connected anymore. Once removed the conversion works at a decent speed again. In short, what should be an easy task had lots of complications and workarounds, some quite weird and difficult to track down, but in the end I learned some interesting things :)

                                  B Offline
                                  B Offline
                                  Bob work
                                  wrote on last edited by
                                  #17

                                  You're in good company!

                                  Quote:

                                  It’s not that I’m so smart, it’s just that I stay with problems longer. -– Albert Einstein

                                  -Bob

                                  1 Reply Last reply
                                  0
                                  Reply
                                  • Reply as topic
                                  Log in to reply
                                  • Oldest to Newest
                                  • Newest to Oldest
                                  • Most Votes


                                  • Login

                                  • Don't have an account? Register

                                  • Login or register to search.
                                  • First post
                                    Last post
                                  0
                                  • Categories
                                  • Recent
                                  • Tags
                                  • Popular
                                  • World
                                  • Users
                                  • Groups