Skip to Content.
Sympa Menu

baslinux - Extracting images from pdf files, was Re: [BL] Re: Interrupts and isapnp

baslinux AT lists.ibiblio.org

Subject: Baslinux mailing list

List archive

Chronological Thread  
  • From: sindi keesan <keesan AT sdf.lonestar.org>
  • To: baslinux AT lists.ibiblio.org
  • Subject: Extracting images from pdf files, was Re: [BL] Re: Interrupts and isapnp
  • Date: Fri, 10 Jun 2005 16:56:48 +0000 (UTC)

The reason I wanted to print out downloaded sheet music was that it is very difficult to scan large pages from books that are printed close to the margins, without losing something, and then I also have to crop the output to fit a particular printer, otherwise it prints the tail end of a page onto the next page.

Well, I just tried printing out TWO different pieces scanned from the same published book of music and available online, and one of them chopped off about half an inch at the bottom, and the other has an extra inch of blank space at the top (they must have lined up the top of the book with the top of the scanner bed) and even more missing at the bottom, and part of the left margin is also missing. When printed, it looks like a pure scan without any editing and is quite nice apart from not being printable.

These are all pdf files and when I try to extract the image so I can crop off the white stuff at the top to make it small enough to fit the bottom
page using a netpbm program that lets you chop off edges (pamcrop) I am always told 'You cannot extract images from this pdf file' or something to that effect, so it appears to have been encoded that way.

This is clearly an image.

The file from one site (the highest quality) did not give me this message but it also did not give me any images. It gave me a bit of text from pdftotext, full of oe's.

When the first type of file is viewed with less, I can see a lot of pdf-type-comments at beginning and end, and in between a couple of sections (one small, one large) of what is probably image file. With David's help I was able to extract the png file from a WORD document using doc2png so I will look for a program to extract the image (png or whatever it is) from these locked pdf files to produce something that I can convert to a pbm file and crop and then print properly. Or edit by hand if I can figure out where the image actually starts. Nuisance.

The sheet feeder may also be at fault, because one of these four pages left 1/2" more than the others at the bottom blank. It tends to grab two pages at once.

I can see everything at page bottom with xpdf but not crop the blasted page. So I could conceivably take a pencil to the page and fill in the missing notes from the screen.

I can also see the entire copy including the part at the left with xpdf, and would like to pad an extra 1/4" of blank space on the left of the image file and crop it off the right side.

I am using an HP Deskjet. Maybe a laserjet would do a better job in the margins, but mine will not print 300 dpi image files due to 1MB RAM.
Do later HPs (mine is 600 series) print to the edge of the page instead of leaving 1/4" blank?

I printed with ghostscript this time (for pdf) but last time used netpbm with the same 1/4" margin problem (on a Deskjet 500).

Would an Epson inkjet print right to the margins? device stcolor for a Stylus 800 color inkjet.

I set up a gs filter for my Panasonic dot-matrix printer, which lets me adjust top and side margins. I used device epson, since the printer does epson LQ, and resolution 360 (LQ). It appears to be printing not 360 but 90 dpi. ???? -r360x360. This is gs 8.50 which I compiled. I had the exact same problem using the older gs binary, but perhaps it is still using the newer device file?

It scrolls down twice as far and prints twice as high characters as it ought to.

I have printed lots of pdf files in DOS on this printer (I am pretty sure it was with device epson and I don't see anything else that would work) and I will try that next.

Maybe some day there will be a small, battery-operated, LCD pdf viewer suitable for using at a piano instead of sheet music. I suppose I could try a laptop computer.





On Fri, 10 Jun 2005, sindi keesan wrote:



While poking around I also found some examples of the sort of output you can get if you are not too careful at:
www.virtualsheetmusic.com.
$37/year gets you unlimited downloads of classical and/or Christmas music for various instruments, and a vote in deciding what to add to the site.

Uncorrected errors included jagged instead of straight lines in music where four 8th notes were connected by a line connecting equal-length stems (sloping), and in another piece where 16th notes were connected by horizontal double lines, these were frequently turned into wide single lines. Sometimes they were a bit of both.

This is a really cheap and convenient way to get copies of lots of music, but it is not as readable as it might be without much editing. But at this price you can't expect people to take a lot of time editing.

If you don't pay the $37, you can download for pay, for instance $6 for the Bach 3-part inventions. This might be cheaper than paper.

Since all of their pieces looked to be the same format but the quality was poor, they are NOT using music publishing software to write them but are scanning from other copies and then removing identifying features, and not doing much of an editing job. It was suggested by my piano teacher that this is pirated work, or at least that many websites offer pirated work from recent published editions.



I also checked out:
sheetmusic1.com - a very small collection of easy pieces for beginners, much better quality, edited to make everything look good except for the phrasing and diagonal lines - I don't think any software used by any of these sites does that right.

www.everynote.com - free views of the first page of over 10,000 pieces, and the samples I downloaded appear to have been scanned but not edited all that well, or the originals were poor, implying that they copied older editions which are no longer copyrighted, so this would be legal. They also were written up in the NY Times. Sixteenth notes often became eighth-note-like due to a double line fusing into a wide single line. They do have a huge selection at $1-2 per piano piece or small collection.

sheetmusicarchives.net. Two free downloads a day or $20 for the CD (excluding Ravel and the 20th century Russians if you don't live in the USA, for legal reasons!). The best quality of all on the two scanned pieces I downloaded, which seem carefully edited but still have slightly jagged phrasing and diagonal lines. They have a smaller but still a respectable collection which is mostly scanned from older public domain editions of public domain pieces, but much of it is also 'computer typeset'. I don't know if this means using a music OCR program with a scanner, or starting from scratch and typing in all the notes from printed copy. Computers must be a real boon to composers.

There is even a free pdf file of a scanned copy of a piece handwritten by Bach, to mix old with new technology.

Too bad linux does not yet have music OCR. I will look into compiling GOCR for text character recognition. There are also separate linux or SunOS OCR programs for Chinese or Japanese, which is really amazing because of so many different characters.

Sorry to sidetrack this discussion away from basiclinux, but most of the above sites also provide MIDI versions of their music files which can be played with OSS sound cards in BL with a sound-enabled kernel while viewing the pdf files with xpdf.

ESS also made some AWE32-compatible sound cards ending in 888.

I have to try listening (with AWE) to something other than piano.

_______________________________________________
BasLinux mailing list
BasLinux AT lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/baslinux


keesan AT sdf.lonestar.org
SDF Public Access UNIX System - http://sdf.lonestar.org




Archive powered by MHonArc 2.6.24.

Top of Page