LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-08-2010, 05:43 PM   #1
tnrooster
Member
 
Registered: Apr 2007
Location: bell buckle tn
Distribution: F13-F14
Posts: 88

Rep: Reputation: 15
sed syntax for binary wrapped eps files gs,epstopdf, illustrator


I'm having a problem with sed syntax.

So far I can sed the HiResBoundingBox to capture the images I want and output to pdf.

But now ever so often I get an illustrator file that has hexadecimal values at the start and end of the file.

Imagemagick powers through this and still creates the rastorized previews I want but the gs dies using the epstopdf script to output the vector files.

If I hand remove the hex on both ends of the file, both functions work fine and the file can still be managed in illustrator but if I resave it the hex comes back.

No idea where it comes from or why. It only happens on a few files plus it seems to serve no purpose as the files work perfectly without it.


I can not get the sed statement to work. I've tried a blue million variations with no luck. Copied some that I found, same result.

Start of bad eps file:

Quote:
^@^@^@5O
^@^@^@^@^@^@^@^@^@UO
^@m^K^@^@^@%!PS-Adobe-3.1 EPSF-3.0^M
The way I need it to look:

Quote:
%!PS-Adobe-3.1 EPSF-3.0^M

End of file the same:

Quote:
%AI9_PrivateDataEnd^M
@ @
just needs to be :

Quote:
%AI9_PrivateDataEnd^M
Tried
Quote:
sed -n '/%/,$p' < = blank file

sed -i 's/%/,$!d/g' = same

sed 's/%/,$!d/g' = same

sed 's/%/,$!d' = same
I can't seem to find any proper reference to this.
 
Old 10-09-2010, 03:34 PM   #2
mario.almeida
Member
 
Registered: May 2008
Location: India
Distribution: Ubuntu 10.04, CentOS
Posts: 179

Rep: Reputation: 27
Hi,

May be something like this you can try.

LN1=$(grep -m 1 -n 'PS-Adobe-[0-9]' filename | awk -F: '{ print $1 }')

LN2=$(sed -n '/AI9_PrivateDataEnd/=' filename)

sed -i "$LN1,${LN2}!d" filename

sed -i '1s/.*\(%!PS-Adobe*\)/\1/' filename

Last edited by mario.almeida; 10-09-2010 at 03:36 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Any program out there that can be used to open Adobe illustrator files and edit them izquierdista Linux - Software 4 04-04-2007 06:51 PM
EPS files destroy themself kvtournh Linux - Software 1 05-05-2005 11:45 PM
.EPS Files won't import on Scribus 1.2 Rockgod2099 Linux - Software 1 11-21-2004 05:48 PM
Help working with .ai files in linux/paging Illustrator users slackist Linux - General 0 07-29-2004 11:24 AM
Sodipodi files to EPS LinuxBlackBox Linux - General 2 05-26-2004 08:00 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:55 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration