Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Inserting Page Number Along With Additional Information
#1
I need to insert page numbers along with other information at the same location in over 300 pages.

It the example below I need to add "Introduction - Page X - Book II" to the center, bottom of a page, 50 pixels from bottom edge to bottom of the text box. X =  page number. Text is size 100, font Times New Roman Bold, anti-aliasing turned off. Later on it will change to "Chapter 1 - Page X - Book II", "Chapter 2 - Page X - Book II", etc.

I'm using Gimp 2.8

Is there a script available to this?

Thanks Sandy

   
Reply
#2
To me, this sounds like a job for a good word processor. You would set this info and page number in a footer. The info and correct page number would transfer to each page. You can change the footer info when you start a new chapter. What program are you using to make the page contents?
Reply
#3
(02-08-2020, 05:43 AM)Pat625 Wrote: To me, this sounds like a job for a good word processor.  You would set this info and page number in a footer.  The info and correct page number would transfer to each page.  You can change the footer info when you start a new chapter.  What program are you using to make the page contents?

The pages are scanned images from a book that has no organization or page numbers.
Reply
#4
Better done with ImageMagick in a shell script IMHO:

http://www.imagemagick.org/Usage/annotating/
http://www.imagemagick.org/Usage/text/

And why turn anti-aliasing off?
Reply
#5
Another suggestion , you can use Irfanview :

- in Irfanview (or other program - Lupas Rename) batch rename your files to your footer names
- click on the Irfanview File / Batch conversion-Rename 
- choose the file folder with your pictures (window up-right)
- click 'Add all' (all your files show op in the window down-right 
- set 'Use advanced options'
- click on Advanced
- set Add overlay text
- click on settings
- fill in coordinates
- set the file name code in the text window '$F'
- click 'ok'

info :
https://daqadoodles.wordpress.com/2012/0...ur-images/

IMPORTANT : 
- make a copy to another folder from your pictures before you use any conversion
- first try the batch out on a few dummy pictures
Reply
#6
I will put this up because it is Gimp Wink Although ImageMagick is preferable and I have not used Irfanview in more than a dozen years.

A plugin add_text-mod.py that will add the file name prefix to the image, so there are caveats.
- file names 001.ext 002.ext 003.ext, which might already be there if the pages are scanned or will need a file name re-namer
- The text is fixed in the script (line 21). It will need editing for Introduction / Chaper / Book XX Use a Windows text editor such as Notepad++
- Works on existing saved / exported images 

Unzip and the plugin  add_text-mod.py  goes in C:\Users\"yourname"\.gimp-2.8\plug-ins  You can try on an existing image as: https://i.imgur.com/hOoBR9e.jpg

For multiple images: You will need to apply to groups of images for Introduction / Chapter..etc using the Gimp batch plugin BIMP 
https://github.com/alessandrofrancesconi.../tag/v1.18
Use 'Other Gimp procedure' search for add text, with settings as: https://i.imgur.com/qx1DweE.jpg


Attached Files
.zip   add_text-mod.zip (Size: 1.24 KB / Downloads: 204)
Reply
#7
(02-08-2020, 11:50 AM)rich2005 Wrote: I will put this up because it is Gimp Wink Although ImageMagick is preferable and I have not used Irfanview in more than a dozen years.

A plugin add_text-mod.py that will add the file name prefix to the image, so there are caveats.
- file names 001.ext 002.ext 003.ext, which might already be there if the pages are scanned or will need a file name re-namer
- The text is fixed in the script (line 21). It will need editing for Introduction / Chaper / Book XX Use a Windows text editor such as Notepad++
- Works on existing saved / exported images 

Unzip and the plugin  add_text-mod.py  goes in C:\Users\"yourname"\.gimp-2.8\plug-ins  You can try on an existing image as: https://i.imgur.com/hOoBR9e.jpg

For multiple images: You will need to apply to groups of images for Introduction / Chapter..etc using the Gimp batch plugin BIMP 
https://github.com/alessandrofrancesconi.../tag/v1.18
Use 'Other Gimp procedure' search for add text, with settings as: https://i.imgur.com/qx1DweE.jpg

Thanks everyone.

Rich

I think this will work fine for this application. I have to rename all the images anyway.

Problem.

Add filename box ... is not active in the menu. I tried selecting the image, that didn't work. Tried ,jpg, .png, .tif formats and that didn't work.

----

update:

I changed Mode from Grayscale to RGB and now it works. Thanks

----

update:

Works like needed, except text box is located from edge of image to edge of text box. If I change the x offset to get Chapter 1 - Page 1 - Book II centered, then Chapter 1 - Page 999 - Book II is offset from center.
Reply
#8
Well, it is a quick modification of an existing script. I did put some comments in and unfortunately pdb.gimp_text_fontname uses the top left corner of the text box as an origin. It is very much hands-on.   Adjustments made on line 52 Not much you can do, maybe pad the page number (file name) out 001 to 999

   

For Grayscale -> RGB I would use BIMP. The available commands can be chained together. 
This screenshot: set RGB / add page number / rename / set output location.  https://i.imgur.com/gEkV6Qp.jpg
Reply
#9
(02-08-2020, 05:27 PM)rich2005 Wrote: Well, it is a quick modification of an existing script. I did put some comments in and unfortunately pdb.gimp_text_fontname uses the top left corner of the text box as an origin. It is very much hands-on.   Adjustments made on line 52 Not much you can do, maybe pad the page number (file name) out 001 to 999

For Grayscale -> RGB I would use BIMP. The available commands can be chained together. 
This screenshot: set RGB / add page number / rename / set output location.  https://i.imgur.com/gEkV6Qp.jpg

Yep. I picked up on the line 52 adjustment.

What I'm doing is throwing up a center guide line, using your plugin to create and place the text, then moving the text box manually to the side until it "snaps" into place. The center of the text box to the guide line. If careful I don't alter the location vertically.

Thanks
Reply


Forum Jump: