Announcement

Collapse
No announcement yet.

PDF String Replacement

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • PDF String Replacement

    Anyone know of any command line linux / windows utilities / programs to do string replacements within PDF's? Potential job where we need to do string replacement into high resolution PDF's. HTML2PDF is not an option as these need to be pixel + resolution perfect for print.

    Any links, ideas, or thoughts would be appreciated.

  • #2
    Re: PDF String Replacement

    Just to clarify, there are existing PDF documents that require some string replacements and the documents cannot lose any image quality.

    If you have the creation rights to the documents, it's just text. You can rerender the document with PDF authoring software after the replacements. If not, it's not a simple string replacement operation anymore. The PDF format doesn't save in plain text. In this case, I don't know of any tools that can help. It's quite a specific task.

    You mentioned HTML2PDF is not an option. Is there another copy of the document in HTML format? Because it doesn't sound like it can go from PDF to HTML. It is called HTML "to" PDF. Maybe somebody can think of a way to use the HTML.

    - It's who you game with.

    Comment


    • #3
      Re: PDF String Replacement

      PDF is a rendering language. Characters are placed individually, and there's no guarantee that adjacent characters in a word in the original document appear together in the PDF instructions. (PDF is actually a specialization of the PostScript programming language.)
      Dude, seriously, WHAT handkerchief?

      snooggums' density principal: "The more dense a population, the more dense a population."

      Iliana: "You're a great friend but if we're ever chased by zombies I'm tripping you."

      Comment


      • #4
        Re: PDF String Replacement

        Well that confirms my thoughts. There are PDF libraries to build PDF's, just not modify them. I'm going to have to build the PDF from scratch up programatically.

        Thanks.

        Comment


        • #5
          Re: PDF String Replacement

          Originally posted by ZaBoo View Post
          Well that confirms my thoughts. There are PDF libraries to build PDF's, just not modify them. I'm going to have to build the PDF from scratch up programatically.

          Thanks.
          nahh. There is at least one .net library that does this kind of thing. We used it to make pdfs into quizzes. One department would create the PDFs and we would randomly replace words with blank boxes.

          Probably more than one.
          Iím not racists, I have republican friends. Radio show host.
          - "The essence of tyranny is the denial of complexity". -Jacob Burkhardt
          - "A foolish consistency is the hobgoblin of little minds" - Emerson
          - "People should not be afraid of it's government, government should be afraid of it's People." - Line from V for Vendetta
          - If software were as unreliable as economic theory, there wouldn't be a plane made of anything other than paper that could get off the ground. Jim Fawcette
          - "Let me now state what seems to me the decisive objection to any conservatism which deserves to be called such. It is that by its very nature it cannot offer an alternative to the direction in which we are moving." -Friedrich Hayek
          - "Don't waist your time on me your already the voice inside my head." Blink 182 to my wife

          Comment


          • #6
            Re: PDF String Replacement

            Originally posted by El_Gringo_Grande View Post
            nahh. There is at least one .net library that does this kind of thing. We used it to make pdfs into quizzes. One department would create the PDFs and we would randomly replace words with blank boxes.

            Probably more than one.
            Replacing a word with a box is easy: The box can be sized to match the omitted word. But replacing a word with another word is hard. The characters of the new word are unlikely to fit in the same space and still look good, like they were intended to fit there.
            Dude, seriously, WHAT handkerchief?

            snooggums' density principal: "The more dense a population, the more dense a population."

            Iliana: "You're a great friend but if we're ever chased by zombies I'm tripping you."

            Comment


            • #7
              Re: PDF String Replacement

              There is at least one .net library that does this kind of thing.
              Any chance you got a name or link?

              The characters of the new word are unlikely to fit in the same space and still look good
              I could care less what it looks like. If the client enters 30 chars when only 20 looks good that's there bad. It would be easier for them & us if we had the ability to replace text. It looks like I am stuck either:

              a) Rebuilding the PDF
              b) Loading a partial PDF without text and putting text ontop

              Comment


              • #8
                Re: PDF String Replacement

                Originally posted by ZaBoo View Post
                I could care less what it looks like. If the client enters 30 chars when only 20 looks good that's there bad.
                Originally posted by ZaBoo View Post
                these need to be pixel + resolution perfect for print.
                I'm confused. Does it need to look good or is it ok to look crappy?
                Dude, seriously, WHAT handkerchief?

                snooggums' density principal: "The more dense a population, the more dense a population."

                Iliana: "You're a great friend but if we're ever chased by zombies I'm tripping you."

                Comment


                • #9
                  Re: PDF String Replacement

                  The idea was business card PDF templates with the ability to change the text on them. So they have to be pixel perfect, specific resolution, and good image quality for printing. The user would view and approve the PDF prior to printing; so in the case of entering too much text - it's not an issue.

                  Sorry if I am confusing ;)

                  Comment


                  • #10
                    Re: PDF String Replacement

                    What are you building the original PDF with?
                    Dude, seriously, WHAT handkerchief?

                    snooggums' density principal: "The more dense a population, the more dense a population."

                    Iliana: "You're a great friend but if we're ever chased by zombies I'm tripping you."

                    Comment


                    • #11
                      Re: PDF String Replacement

                      Sounds like it would be better to work with an image template and overlay some text on it. Unless there's a requirement to use PDF, it might be better to start with a different format as the template. It sounds like you're looking for something similar to what engraving companies might do.

                      Apple has a similar preview for their iPod engravings. You can add in your own text and it shows up on a picture of an iPod. If you take that idea and raise the resolution of the template image, you can added whatever you want in whatever detail for the end product.

                      - It's who you game with.

                      Comment

                      Connect

                      Collapse

                      TeamSpeak 3 Server

                      Collapse

                      Advertisement

                      Collapse

                      Twitter Feed

                      Collapse

                      Working...
                      X