Path: news.mathworks.com!newsfeed-00.mathworks.com!news.tele.dk!feed118.news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!xs4all!peer.news.zetnet.net!peer-uk.news.demon.net!kibo.news.demon.net!news.demon.co.uk!demon!not-for-mail
From: Ken Starks <straton@lampsacos.demon.co.uk>
Newsgroups: comp.soft-sys.matlab,comp.text.tex,comp.text.pdf
Subject: Re: how to convert Excel tables/charts into EPS or PDF without losing
Date: Wed, 27 Aug 2008 23:40:04 +0100
Lines: 179
Message-ID: <g94l45$sko$1$8302bc10@news.demon.co.uk>
References: <6c992901-589d-4ff9-adf8-bcb55e97766a@v13g2000pro.googlegroups.com> 	<eae23df1-bff7-4bb1-84e3-711603d2c122@s20g2000prd.googlegroups.com> 	<f4b2f7a5-535f-426f-9c30-8708b078e98c@m3g2000hsc.googlegroups.com> 	<g934o2$1nb$1$8302bc10@news.demon.co.uk> <33e5bc81-53a0-4752-88cf-e15f74521676@f36g2000hsa.googlegroups.com> 	<g93tl0$qor$1$8300dec7@news.demon.co.uk> <7d045ca1-954d-43f9-8229-cedf4f737622@e39g2000hsf.googlegroups.com>
NNTP-Posting-Host: lampsacos.demon.co.uk
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.demon.co.uk 1219876806 29336 62.49.22.91 (27 Aug 2008 22:40:06 GMT)
X-Complaints-To: abuse@demon.net
NNTP-Posting-Date: Wed, 27 Aug 2008 22:40:06 +0000 (UTC)
In-Reply-To: <7d045ca1-954d-43f9-8229-cedf4f737622@e39g2000hsf.googlegroups.com>
User-Agent: Thunderbird 2.0.0.16 (Windows/20080708)
Xref: news.mathworks.com comp.soft-sys.matlab:487562 comp.text.tex:393799 comp.text.pdf:86759



Luna Moon wrote:
> On Aug 27, 11:59 am, Ken Starks <stra...@lampsacos.demon.co.uk> wrote:
>> LunaMoon wrote:
>>> On Aug 27, 4:54 am, Ken Starks <stra...@lampsacos.demon.co.uk> wrote:
>>>> Luna Moon wrote:
>>>>> On Aug 26, 8:17 am, David Klassen <klas...@rowan.edu> wrote:
>>>>>> On Aug 26, 8:09 am, Luna Moon <lunamoonm...@gmail.com> wrote:
>>>>>>> how to convert Excel tables/charts into EPS or PDF?
>>>>>>> Hi all,
>>>>>>> I am creating tables and charts in Excel and then I want to convert
>>>>>>> them into EPS or PDF (one chart/table per pdf file) so I could use
>>>>>>> them in Latex. It is also a means of maintaining tables/charts without
>>>>>>> losing quality. Any fast convenient way of doing so?
>>>>>>> Any thoughts?
>>>>>> "Print" them to a file using a postscript or PDF driver.  On a Mac
>>>>>> this is as simple as choosing "Print" and then clicking on the
>>>>>> "Save to PDF" button.  On a PC you'll need to... well, this page
>>>>>> has all the details---http://www.freeopenbook.com/pdf-hacks/pdfhks-CHP-4-SECT-9.html
>>>>>> I did this for my WinXP setup and it works wonderfully.
>>>>> this is bad because when you print to pdf the one table is splitted to
>>>>> several pages and cropped.
>>>> I suddenly feel a need to clarify your question, Luna.
>>>> 1. Are your Excel tables pretty much simple data in cells, one cell to
>>>>     each row and columns?
>>>>     Or do some cells span more than one row and column.
>>>> 2. Do you have formatting you wish to preserve - bold, italics,
>>>>     and so on.
>>>> 3. Do you have row or Cell border-lines you wish to preserve ?
>>>> The answers to these questions may not only alter the difficulty
>>>> of the task, but also affect whether LaTeX is an appropriate
>>>> solution at all.
>>>> Cheers,
>>>> Ken.
>>> Sure, my tables and charts in Excel have lots of decorations and
>>> patterns and colors that we don't want to lose.
>>> Probably the easiest is to Save As pdf, but I hope it has a tight
>>> bounding box. I just need to convert a selection of table/chart into
>>> PDF, not the whole document or the whole sheet. Without a tight
>>> bounding box, how can I use it in Latex?
>> Yes, I would agree. There is a slight difference between 'save as PDF'
>> and 'Print to PDF' which you might need to investigate.
>>
>> It all comes down to the quality of the driver. I have the
>> luxury of acrobat professional on my machine, and the results
>> of 'Print to PDF' are excellent. You would first select your table and use:
>> menubar -->file --> set Print Area -->
>>
>> This gives a PDF the correct size, and restricted to the selected area.
>> (You can use print preview before preesing the print button if
>> you like)
>>
>> As for your other problem, of a table being split over two pages, a
>> good driver allows you to set an arbitrary pages size for the
>> final PDF, so a bit of experimentation is all you need.
>>
>> What you won't have, with this method, is matching font style and size
>> with the fonts in the remainder of your document.
> 
> Could you please clearly list the steps to make PDF with tight
> bounding box and no splitting across pages and fit every table each
> into one page, (I mean, my Excel tables/charts were designed to be
> inserted into a typical report which is readable on Letter size paper.
> The width and height are very reasonable. )
> 
> How to do that?

I can't speak for every 'PDF printer', but I can tell you
how to use the one I have, the one that came with Acrobat
Professional. I can't say whether Open-source
PDF printers have a similar interface or not.


Firstly you need to establish the maximum size of graphic
that will actually be acceptable to your final document,
if imported.

for the purposes of the following, I found that
Letter paper with a one-tenth of an inch margin would
accept a pdf of 8 x 10.5 inches.

I therefore decided that I would crop the Table printout
to this size at maximum, possibly not completely
as a 'tight' bounding box in method one.

##############################################

This method was tested, after saving an excel table as
'Workinghours.pdf' with the following minimal LateX
document:


\documentclass{article}
\usepackage{geometry}
\geometry{letterpaper, portrait, top=0.1in, bottom=0.1in, left=0.1in, 
right=0.1in}
\usepackage[pdftex]{graphicx}
\begin{document}
\includegraphics{HoursofWork} % pdf image of 8 x 10.5 inches
\end{document}


###############################################



Method one: I set up three custom page sizes in my PDF
printer, as follows:

Sub_Letter: 8 x 10.5 inches
Halfsub_Letter 8 x 5.0 inches
QuarterSub_Letter 8 x 2,5 inches

(You can make as many as you wish)


How? get to the printer dialogue box e.g.

1. Control panel --> Printers and faxes -->

2. Right Click on 'Adobe PDF', choose 'Printing preferences ...'

3. Use the TAB 'Adobe pDF settings'

4. Go to the 'Adobe PDF Page Size' drop-down list, and click the
    'Add...' button next to it.

5a. Fill in the form for your custom pages size:

    Paper Names : Sub_Letter
    Units : Inch
    Width: 8.0
    Height: 10.5

Press the Add/modify button when you are finished.

5b, 5c, etc: repeat for other custom sizes you want.

#######################################


Back in Excel.

1. Select the table you want.
    Menubar --> Print area --> Set Print Area

2. Menubar --> File --> Page setup ... Page TAB

Orientation. Portrait
Adjust to: 100  %normal size
Paper size: Sub_Letter

3. (Optional) Menubar --> File --> Print Preview (Esc)

4. Menubar --> File --> Print



###############################################################

Method Two. Print to whatever size PDF, and crop afterwards.

Someone else has already mentioned the open-source Ghostscript method.
I don't know how similar the functionality might be, but the user
interface is likely to be very different.

This is what you would do in acrobat professional.

Menubar --> Tools  --> Advanced editing --> crop tool ...

interactive crop by click and drag...
when done, double-click to get a dialogue box for
precision final choices.

You also get a 'remove white margins' option as an alternative
to the click and drag method.