#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2014
    Posts
    139
    Rep Power
    4

    is there any way to display page number when I print some text file?


    Hello guys,

    Is there any way to display the page number on text file (generate by PHP), I need to print a text file, but when I use headers then add path of file and page number, I need only the page number.

    Thanks for the help.
  2. #2
  3. Impoverished Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    16,739
    Rep Power
    9646
    You already have the file path and page number, and you want only the page number? Then... remove the file path.

    Am I missing something?
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2014
    Posts
    139
    Rep Power
    4
    Originally Posted by requinix
    You already have the file path and page number, and you want only the page number? Then... remove the file path.

    Am I missing something?
    Yes, maybe my english is bad, sorry for that.

    I can add interactively pressing check to add header (this adds path of file and number of page simultaneously), I suppose there is a command that can be added only page number when I want to print a text file, that I want to know.

    Thanks for the help !.
  6. #4
  7. Impoverished Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    16,739
    Rep Power
    9646
    What is adding the header? PHP code? Something else?
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2014
    Posts
    139
    Rep Power
    4
    via terminal on Centos:

    Code:
    lpr - h -Pprinter text-to-printer.txt
    This command adds the name of path to file, and page number, to the text-to-printer.txt, I only need page number, is there any way?

    Thanks for help
  10. #6
  11. Impoverished Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    16,739
    Rep Power
    9646
    Ohh...

    Using CUPS? Use lpoptions to see what kinds of printing options you have. Then pass the ones you want to lpr like
    Code:
    lpr -h -Pprinter -o key1=value1 -o key2=value2 text-to-printer.txt
    Or you can use lpoptions to set values, or put them in ~/.cups/lpoptions for defaults.

    Do a `man lpr` or `man lpoptions` to learn more.
  12. #7
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2017
    Posts
    2
    Rep Power
    0
    If you are using Microsoft word then its easy. Go to Microsoft word select insert -> select page numbers -> select top of the pages. Now you got the numbers.

IMN logo majestic logo threadwatch logo seochat tools logo