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. General Programming
  3. C#
  4. LPR failed on Edited PRN file

LPR failed on Edited PRN file

Scheduled Pinned Locked Moved C#
help
4 Posts 2 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.
  • B Offline
    B Offline
    balu12345
    wrote on last edited by
    #1

    Hi All, I have .Prn file which was generated out of PCL printer.I need to find a string in that file and then I have to replace it with another string. Iam able to do it by using stream writer,streamreader,Binary reader,binary writer and file streams. But if gave a print(LPR)for it, it get failed and giving me syntax error as Illegal tag. If I print original file it is printing very well. I came to know that while writing it has lost some of its originality ,so it was failed Please help me Thanks in advance

    A 1 Reply Last reply
    0
    • B balu12345

      Hi All, I have .Prn file which was generated out of PCL printer.I need to find a string in that file and then I have to replace it with another string. Iam able to do it by using stream writer,streamreader,Binary reader,binary writer and file streams. But if gave a print(LPR)for it, it get failed and giving me syntax error as Illegal tag. If I print original file it is printing very well. I came to know that while writing it has lost some of its originality ,so it was failed Please help me Thanks in advance

      A Offline
      A Offline
      Ashfield
      wrote on last edited by
      #2

      balu12345 wrote:

      I have to replace it with another string.

      Thats probably whats wrong then. Either the value you are replacing with is illegal OR you are replacing something you didn't mean to. Why not save both the original and your new version to disk and compare them - there are loads of free utilities to compare files.

      Bob Ashfield Consultants Ltd Proud to be a 2009 Code Project MVP

      B 1 Reply Last reply
      0
      • A Ashfield

        balu12345 wrote:

        I have to replace it with another string.

        Thats probably whats wrong then. Either the value you are replacing with is illegal OR you are replacing something you didn't mean to. Why not save both the original and your new version to disk and compare them - there are loads of free utilities to compare files.

        Bob Ashfield Consultants Ltd Proud to be a 2009 Code Project MVP

        B Offline
        B Offline
        balu12345
        wrote on last edited by
        #3

        Hi, Thanks for the reply, The original file size is like 16k, after the editing it becoming as 22k.. more over it is not normal file,It is a file generated by PCL printer. So may be during the conversion it is losing printer supported font. so that's the reason printer cannot understand the file(after editing)to print.so it gives syntax error as Kernel and Illegal tag error. I even cannot compare both file because the file is generated by PCL printer which has some non-readable data I have no clues to overcome this problem kindly help me

        A 1 Reply Last reply
        0
        • B balu12345

          Hi, Thanks for the reply, The original file size is like 16k, after the editing it becoming as 22k.. more over it is not normal file,It is a file generated by PCL printer. So may be during the conversion it is losing printer supported font. so that's the reason printer cannot understand the file(after editing)to print.so it gives syntax error as Kernel and Illegal tag error. I even cannot compare both file because the file is generated by PCL printer which has some non-readable data I have no clues to overcome this problem kindly help me

          A Offline
          A Offline
          Ashfield
          wrote on last edited by
          #4

          balu12345 wrote:

          The original file size is like 16k, after the editing it becoming as 22k..

          So basically what you are doing has corrupted it.

          balu12345 wrote:

          it is not normal file,It is a file generated by PCL printer.

          Yes, so unless you know the format of the file you will mess it up.

          balu12345 wrote:

          I even cannot compare both file because the file is generated by PCL printer which has some non-readable data

          Ther eis no such thing as unreadable data. Use a hex editor to compare, there are plenty freely avalable. It does beg the question though, why do you have to change the PCL file rather than the original data.

          Bob Ashfield Consultants Ltd Proud to be a 2009 Code Project MVP

          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