f



Printing text, image, text, image, ...

I have bunch of text files (about 20 lines) and bunch of image files.
Is there a clean way to print text, then image, then text, then image,
...., as though there are in single continuous document?

-- 
William Park <opengeometry@yahoo.ca>, Toronto, Canada
ThinFlash: Linux thin-client on USB key (flash) drive
	   http://home.eol.ca/~parkw/thinflash.html
BashDiff: Super Bash shell
	  http://freshmeat.net/projects/bashdiff/
0
William
6/24/2006 12:01:01 AM
comp.unix.shell 15484 articles. 2 followers. Post Follow

2 Replies
1501 Views

Similar Articles

[PageSpeed] 46

["Followup-To:" header set to comp.os.linux.misc.]
On Fri, 23 Jun 2006 20:01:01 -0400, William Park staggered into the
Black Sun and said:
> I have [a] bunch of text files (about 20 lines) and [a] bunch of image
> files.  Is there a clean way to print text, then image, then text,
> then image, as though [they were a] single continuous document?

Sure.

#!/usr/bin/perl -w
open(OFP,">temp.html") or die "cannot open temp.html: $!";
print OFP "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 ".
     "Transitional//EN\">\n";
print OFP "<html><head><title> A title </title></head><body>\n";

# populate @textfiles with textfile1, textfile2 ...
# populate @imagefiles with imagefile1, imagefile2 ...
# NOTE:  The glob() builtin may or may not help you out with that.
# Keep track of how many files you have, put that number in N.
# Deal With It if you have more images than text, or more text than
# images.  That's beyond the scope of this message.

for($i=0;$i<$N;$i++) {
    print OFP "<p>\n";
    open(IFP,$textfiles[$i]) or die "couldn't open ".$textfiles[$i].
         " : $!";
    while($line=<IFP>){ print OFP $line; }
    close(IFP);
    print OFP "</p>\n";
    print OFP "<img src=\"".$imagefiles[$i]."\">";
    }
print OFP "</body></html>\n";
close(OFP);
# end hackish Perl script

....open temp.html in your favorite web browser, make sure it looks OK,
File->Print.  Modify the code to your taste in scripting languages if
you don't like Perl--this'd be fairly easy to do in Python or bash
AFAICT.  HTH,

-- 
Matt G|There is no Darkness in Eternity/But only Light too dim for us to see
Brainbench MVP for Linux Admin /    mail: TRAP + SPAN don't belong
http://www.brainbench.com     /    "He is a rhythmic movement of the
-----------------------------/      penguins, is Tux." --MegaHAL
0
Dances
6/24/2006 1:07:10 AM
In <comp.os.linux.misc> Dances With Crows <danSPANceswitTRAPhcrows@gmail.com> wrote:
> ["Followup-To:" header set to comp.os.linux.misc.]
> On Fri, 23 Jun 2006 20:01:01 -0400, William Park staggered into the
> Black Sun and said:
> > I have [a] bunch of text files (about 20 lines) and [a] bunch of image
> > files.  Is there a clean way to print text, then image, then text,
> > then image, as though [they were a] single continuous document?
> 
> Sure.
> 
> #!/usr/bin/perl -w
> open(OFP,">temp.html") or die "cannot open temp.html: $!";
....
> print OFP "<html><head><title> A title </title></head><body>\n";
....
> for($i=0;$i<$N;$i++) {
>     print OFP "<p>\n";
....
>     print OFP "</p>\n";
>     print OFP "<img src=\"".$imagefiles[$i]."\">";
>     }
> print OFP "</body></html>\n";
> close(OFP);
> # end hackish Perl script
> 
> ...open temp.html in your favorite web browser, make sure it looks OK,
> File->Print.  Modify the code to your taste in scripting languages if
> you don't like Perl--this'd be fairly easy to do in Python or bash
> AFAICT.  HTH,

Excellent suggestion.  I was about to use LaTeX template, because I can
script the process.  But, producing HTML file does have its advantage.

-- 
William Park <opengeometry@yahoo.ca>, Toronto, Canada
ThinFlash: Linux thin-client on USB key (flash) drive
	   http://home.eol.ca/~parkw/thinflash.html
BashDiff: Super Bash shell
	  http://freshmeat.net/projects/bashdiff/
0
opengeometry (485)
6/24/2006 6:35:04 PM
Reply:

Similar Artilces:

Text in images to a text file
Hello, Does anyone know of any software for Linux which converts text in images to a text file. I have loads of paper documents that I intend to scan. The contents of these documents needs to eventually end up on a web site but as text. Darren <bobblebob@gmail.com> wrote in message news:1151612491.407262.124690@75g2000cwc.googlegroups.com > Does anyone know of any software for Linux which converts text in > images to a text file. I have loads of paper documents that I intend > to scan. The contents of these documents needs to eventually end up > on a web site but as text....

Resizable image with image text
I'm looking for some help with a group of templates for images on my blog. The images appear in the main content column, and will normally span 100% of its allocated width. The column layout is flexible and I want the images to resize automatically with it. Here's my solution: <div class="image-box"> <img src="..."/> <div class="image-text">...</div> </div> ..image-box { clear: both; } ..image-box img { display: block; width: 100%; } ..image-text { padding: 6px 10px 8px 10px; ba...

How to.. Large image and text over image?
L.S., (just started using LaTeX 4 months ago) I have written my thesis and it's almost ready to be printed, but I have two problems: For my titlepage I've made an image which covers 98% of an A4-paper (size used to print my thesis on). The first problem is about the size of the image: how do I get the image to be correctly centered on the title-page. I've tryed serveral things, but none seemed to help. The second problem is that over the image text will have to be displayed and printed. The image is a background-image, so to say. How can I do this? Thank for your help, Koos On W...

Text IN an Image To Straight Text?
Hi. (I'm not sure where to ask this so I'm trying a few newsgroups) I have some .jpg's of text documents. Is there a utility which will work like OCR in a scanner, helping to convert the text WITHIN the image to straight text? I don't have a printer working at the moment, or I'd print the .jpg's and then scan them using OCR. (The format doesn't necessarily have to be .jpg) Thanks in advance for any help GP Yes, if the image is not to bad a pic (not much noise and all that). Try http://www.twocows.com/windows.html I know they have a couple of ocr programs s...

aligning text and image-text
I use a program to make Email addresses harder for spammers to harvest. It converts them to slightly blurred images using http://mindprod.com/products1.html#MASKER When I embed them in text, I have figured out how to get them to align naturally with the surrounding text, but the browser inserts extra inter-line spacing above the line containing the image. You can see the effect at http://mindprod.com/book/books.html at the bottom of the page where it says: "Please email your feedback for publication, letters to the editor, errors, omissions, typos, formatting errors, ambig...

Text and Image inside table <td> Alight Text Left and Image right in same cell ??
Is that possible? How? <td > <asp:Label ID="StartDateLabel" runat="server" Text="Start Date:"> <asp:imagebutton ID="Imagebutton1" width=18 Height=18 CommandName=SetDate imageUrl="../cal.jpg" runat=server /> </asp:Label> </td> <td > On 2006-10-24, Jason <jason@cyberpine.com> wrote: > Is that possible? How? Set text-align: left on the cell as usual (it's likely to be the default), and make the image float: right. To work around a Firefox float bug, better to put the image befor...

Printing a text over an image
Hi guys, Using python, wxpython and sqlite in a windows system, Im trying to print some certificates/diplomas/cards with a image at background with the name of person/text over it. I know the basic steps to print the text using win32print from Pywin32 but...: 1) I dont know how to add an image and set it to background. while ..... ..... # Query sqlite rows and collumn name and set the self.text for each certificate ..... # Now send to printer DC = win32ui.CreateDC() DC.CreatePrinterDC(win32print.GetDefaultPrinte...

convert text images in pdf to text
Hi, I have a pdf file where someone scanned in pages from a book and stored them as images in a pdf file which is 16 meg. Is there an easy way I can do some kind of OCR on this file to just get plain text from the images of text in the pdf? Using a standard pdf to txt converter won't work because the file contains images of text as it appears in the book. Thanks, Ben -- Cheap long distance calling using Onesuite (http://www.onesuite.com). 2.5 cents/min anywhere in the U.S., to Canada or the U.K. No monthly or connection fees! Use promotional code 038664643 for 20 free minutes. Tr...

Replace text with image in text widget
I'm trying to replace an emoticon with an actual image in a text widget. I know I'm not doing this correctly: the sample code below inserts two images randomly and seems to garble the text in other ways. The idea is to have two emoticons (one on each line) and replace them with an image, nothing more. Can anyone take a look and suggest how I might get this to work? Thanks. --- SPfHZvvOGvfQEvfGdvjQE/rNMfrOMfrNPfvQHfzQHfjQLfrNRvjQL/vRJfzRJvrOWvbMh/3VHPfM h/3WHPzVMP7XF/zVMfrPdv7YGP7YG/7YHPzWPPzWPfvUVP7ZHf7ZIPvWVf7aJv7aJ/7bJv7bM/7b NP7cLf7dMPvXeP7dNvrVlv7eOPrWlvvaevrYmP7gRP7gRf7gRv7i...

PDF image of text to readable text ?
Seems there are web based tools and software. My son needs text to have it read for him. He has a PC. Found PDF reader $50 , http://thurly.net/11ia and http://thurly.net/11i4 the last being google. Wondering what you folks found useful or use ? Thanks! -- Bill S. Jersey USA zone 5 shade garden http://uppitywis.org/ live WI ...

Scanned text (image) needs to be converted to text
Hello all, I have a PDF of a contract that was scanned in and stored as an image (so we can't select the text). Is there any way to convert an image to text (preferably built in to Adobe Acrobat or a free plug-in)? We are using Adobe Acrobat 5.0. Thanks for any help anyone can provide, Conan Kelly Conan Kelly wrote: > Hello all, > > I have a PDF of a contract that was scanned in and stored as an image > (so we can't select the text). > > Is there any way to convert an image to text (preferably built in to > Adobe Acrobat or a free plug-in)? > &...

replace instances of text on page with image or other text?
Hello, I need to look through the text on a page and replace certain words with an image or other word something like: read document find all instances of the word "blah" change all instances of the word "blah" to <img src="MyPicture.jpg" > (jeez, I don't get why computers cant just read english!<G>) and, no, I cant just change the page with 'find/replace' in notepad. -- thanks, juglesh B>{)} "juglesh" <juglesh@nospamRadioKDUG.com> wrote in message news:Sj_xd.302269$R05.120039@attbi_s53... > Hell...

Text printing mirror image
My computer has just developed a strange printing symptom: Pages which contain only text print mirror image. If there is any graphic content on the page, they print normally. If the document contains some pages with graphics, and some without, the pages with graphics print normally; those without print mirror image. The problem occurs with NotePad, WordPad and Word 2000. Outlook, Outlook Express, and IE 6 print normally. I run Windows 2000, recently upgraded to SP4 with all critical patches. My printer is an Epson 750, running as an LPR printer (on a "pocket" p...

Dynamic text: modify text by image/link click
Hello, The effect i'm trying for: Tha tthe user clicks an image, and a line of text on the page changes. I'd like to make it so that this could be done over and over with different links. But this isn't working. I think the problem is related to a refresh not happening, but I'm just learning the javascript ropes. Thanks in advance for your help. -Dave --code follows *attempt*1* var avar = 'beforeclick'; //defined in body //included document.write(avar) in text. it shows up in text, but doesn't change on click. function newtext(){ document.write(avar); return fal...

Web resources about - Printing text, image, text, image, ... - comp.unix.shell

Printing - Wikipedia, the free encyclopedia
This article is about the process of reproducing text and images. For the handwriting method often called printing, see block letters . For other ...

Napa Valley Register Bids Farewell to Massive Printing Press
There is a wonderful analogy articulated in Napa Valley Register city editor Kevin Courtney ’s account of the end of the in-house printing era ...

Firefox 44 adds H.264 video support on desktop, supports cloud printing on Android
... its heels. Like the previous release, the most visible changes are reserved for the mobile build. Android users gain support for cloud printing ...

This 3D printing pen is just what you need to bring your art to life
3D printing is all the rage these days because it's pretty awesome to make your concepts into a physical reality, and having a 3D printing pen ...

Stratasys Partners with Adobe to Broaden Adoption of 3D Printing with New Color Experience and Simplified ...
Stratasys Ltd. (Nasdaq:SSYS), the 3D printing and additive manufacturing solutions company, today announced that it has taken color 3D printing ...

Worldwide spending on 3D printing forecast to grow at a CAGR of 27% to more than US$26 billion in 2019 ...
According to IDC, global spending on 3D printing will grow at a 27% CAGR from nearly US$11 billion in 2015 to US$26.7 billion in 2019.

ICYMI: Printing in 4D, solar panel breakthrough and more
Today on In Case You Missed It: Scientists at Harvard have figured out how to print incredibly small, shape-shifting creations out of hydrogel ...

8 Hot 3D Printing Trends to Watch in 2016
Even as the overhyped consumer 3D printing market continues to fall back down to earth, 2016 looks to be a breakout year for the industry assenior ...

Airbus Ventures dips into $150 million fund to back 3-D printing at Local Motors
Airbus Ventures, the European aerospace giant’s Silicon Valley spin-off, says the first investment from its $150 million venture fund is going ...

New Research Sheds Light on 3D Printing Fumes
... a lot of people in the community, the science wasn’t entirely conclusive — one paper made it sound like you needed a hazmat suit for 3D printing, ...

Resources last updated: 2/5/2016 3:02:30 AM