OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

OpenOffice 1.1.4 (Linux) creates huge PDF files
Goto page 1, 2  Next
 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Writer
View previous topic :: View next topic  
Author Message
janeri
General User
General User


Joined: 08 Apr 2004
Posts: 24
Location: Bærum, Norway

PostPosted: Sat Jan 15, 2005 5:34 am    Post subject: OpenOffice 1.1.4 (Linux) creates huge PDF files Reply with quote

I use Writer to create PDF files of simple pure-text documents, just a few pages. The Writer files are around 10 kb.

Still the PDF file ends up as 500 kb "monsters", even if using screen optimalization. What can I do to fix this?
Back to top
View user's profile Send private message
hol.sten
Super User
Super User


Joined: 14 Nov 2004
Posts: 3532
Location: Hamburg, Germany

PostPosted: Sat Jan 15, 2005 6:58 am    Post subject: Re: OpenOffice 1.1.4 (Linux) creates huge PDF files Reply with quote

janeri wrote:
I use Writer to create PDF files of simple pure-text documents, just a few pages. The Writer files are around 10 kb.

Still the PDF file ends up as 500 kb "monsters", even if using screen optimalization. What can I do to fix this?

I have the same problems with PDF files generated from OOo and analysed the resulting PDF files on different platforms. There are several reasons for the huge size of PDF files:
- PDF files generated with OOo using Linux are not compressed. I once wondered myself why the same PDF files generated with OOo on Windows and Solaris are only halve the size of PDF files generated with OOo on Linux. And the answer is, that OOo on Windows and Solaris compresses the PDF files which isn't done on Linux. Don't ask me why. But analyzing the source code of OOo I found that there is a compression option. It seems to be disabled while compiling OOo for Linux. So if you generate your PDF file on Windows or Solaris it's only halve the size it has now.
- PDF files generated with OOo include nearly ALL the fonts that are used in the writer document. The size of a PDF increases dramatically if you use on Windows a TrueType font which has several fonts for several styles. For example "Arial". Arial has TrueType fonts for normal text, bold text, italic text and perhaps some more. So if you use all this font styles in on writer document ALL the fonts are included in the PDF file. OOo tries to optimize the size by only including used letters of a font. It builds so called font subsets. With other fonts than Arial, that don't have several fonts for several styles the PDF size doesn't increase that much. OOo doesn't include all fonts. There are some default fonts which are never included. So far I only know that on Linux Helvetica will not be included. So using this font will reduce your file size. Does anyone know more fonts which arn't inluded? I still haven't found them in the OOo source although I know that there are 13 of them. To further analyze the fonts inside a PDF file use on Linux the command "pdffonts" http://www.die.net/doc/linux/man/man1/pdffonts.1.html.
- The optimization of PDF files works. But only for documents including pictures. If your document contains no pictures, the optimization is totally useless. All PDF files will have the same size. Try including a picture in your document and generate PDF files with different optimizations. You'll see the difference in file size and in the picture quality.

With kind regards
hol.sten
Back to top
View user's profile Send private message
janeri
General User
General User


Joined: 08 Apr 2004
Posts: 24
Location: Bærum, Norway

PostPosted: Sat Jan 15, 2005 7:52 am    Post subject: Reply with quote

Thanks for the reply - good to know it's not only me. I also tried the 2.0 beta, but it was just as bad regarding size of PDF files.

I need to find a working tool to create PDFs under Linux. Unfortunately, OpenOffice is not it yet.

I tried printing from OO to a PS file and then used

ps2pdf -dUseFlateCompression=true test.ps

The resulting test.pdf was 40kb, less that 10% of the PDF from OO
Back to top
View user's profile Send private message
hol.sten
Super User
Super User


Joined: 14 Nov 2004
Posts: 3532
Location: Hamburg, Germany

PostPosted: Sat Jan 15, 2005 8:41 am    Post subject: Reply with quote

janeri wrote:
I tried printing from OO to a PS file and then used

ps2pdf -dUseFlateCompression=true test.ps

The resulting test.pdf was 40kb, less that 10% of the PDF from OO

I think that that document contains no TrueType fonts. So it's no wonder that it is smaller. Have you compared the output of both PDF files with "pdffonts"? Have you tried to use the TrueType font "Helvetica" in OOo and export your document then as PDF? Does that also reduce the size? I think so.

With kind regards
hol.sten
Back to top
View user's profile Send private message
janeri
General User
General User


Joined: 08 Apr 2004
Posts: 24
Location: Bærum, Norway

PostPosted: Sun Jan 16, 2005 5:06 pm    Post subject: Reply with quote

hol.sten wrote:
Have you tried to use the TrueType font "Helvetica" in OOo and export your document then as PDF? Does that also reduce the size?

I tried to use only TT font Helvetica, but the size was still 270kb, far to much. I haven't had the time to investigate further with pdffonts, I am just happy that I could solve it with ps2pdf

Thanks for the input!

regads,
JanE
Back to top
View user's profile Send private message
DaveQB
Power User
Power User


Joined: 17 Apr 2004
Posts: 50
Location: Sydney

PostPosted: Thu Jan 20, 2005 5:51 am    Post subject: Reply with quote

hmmmm interesting.

I havent stumbled across this.

Having a poke around i see i havent any 'huge' PDF files created by OOo, in fact i made PDF's of the files i am working on an and all of them made PDF's half the size of the original sxc file.

Mandrake RPM's must be compiled with this PDF compression Confused

I am happy Very Happy
Back to top
View user's profile Send private message
hol.sten
Super User
Super User


Joined: 14 Nov 2004
Posts: 3532
Location: Hamburg, Germany

PostPosted: Thu Jan 20, 2005 11:27 am    Post subject: Reply with quote

DaveQB wrote:
in fact i made PDF's of the files i am working on an and all of them made PDF's half the size of the original sxc file.

Mandrake RPM's must be compiled with this PDF compression Confused

As I wrote in another posting, also the SuSE-Version of OOo uses compression.

Question: Please, can you tell me, which fonts do you use. Is it perhaps also possible to post the output of "pdffonts" (http://linux.about.com/library/cmd/blcmdl1_pdffonts.htm) here? I'm still looking for the fonts that OOo doesn't included in PDF files.

With kind regards
hol.sten
Back to top
View user's profile Send private message
DaveQB
Power User
Power User


Joined: 17 Apr 2004
Posts: 50
Location: Sydney

PostPosted: Thu Jan 20, 2005 1:29 pm    Post subject: Reply with quote

1 sxc file had Helvetica and arial
and its pdffonts output is:

Code:

name                       type         emb sub uni object ID
------------------------------------ ------------ --- --- --- ---------
Helvetica                  Type 1       no  no  no       7  0
Helvetica-Bold             Type 1       no  no  no       6  0



The other file had just helvetica and its pdffonts output is:

Code:

name                       type         emb sub uni object ID
------------------------------------ ------------ --- --- --- ---------
Helvetica                  Type 1       no  no  no       8  0
Helvetica-Bold             Type 1       no  no  no       9  0



Hope that helps
Back to top
View user's profile Send private message
hol.sten
Super User
Super User


Joined: 14 Nov 2004
Posts: 3532
Location: Hamburg, Germany

PostPosted: Sat Jan 22, 2005 1:10 am    Post subject: Reply with quote

DaveQB wrote:
1 sxc file had Helvetica and arial
and its pdffonts output is:

Code:

name                       type         emb sub uni object ID
------------------------------------ ------------ --- --- --- ---------
Helvetica                  Type 1       no  no  no       7  0
Helvetica-Bold             Type 1       no  no  no       6  0



The other file had just helvetica and its pdffonts output is:

Code:

name                       type         emb sub uni object ID
------------------------------------ ------------ --- --- --- ---------
Helvetica                  Type 1       no  no  no       8  0
Helvetica-Bold             Type 1       no  no  no       9  0



Hope that helps

Ok, that explains the small size of your PDF document: It contains no TrueType fonts. And I know now two of the not embedded fonts: Helvetica and Helvetica-Bold. Thanks.

With kind regards
hol.sten
Back to top
View user's profile Send private message
DannyB
Moderator
Moderator


Joined: 02 Apr 2003
Posts: 3991
Location: Lawrence, Kansas, USA

PostPosted: Tue Jan 25, 2005 7:14 am    Post subject: Reply with quote

I tried a macro like this for exporting to PDF.

Code:

Sub Main
   oDoc = ThisComponent
   
   cFile = "C:\Documents and Settings\dbrewer\Desktop\Test\Test0.pdf"
   cUrl = ConvertToUrl( cFile )
   oDoc.storeToUrl( cUrl,_
      Array(_
         MakePropertyValue( "FilterName", "writer_pdf_Export" ) ) )

   cFile = "C:\Documents and Settings\dbrewer\Desktop\Test\Test1.pdf"
   cUrl = ConvertToUrl( cFile )
   oDoc.storeToUrl( cUrl,_
      Array(_
         MakePropertyValue( "FilterName", "writer_pdf_Export" ),_
         MakePropertyValue( "FilterData",_
            Array(_
               MakePropertyValue( "CompressionMode", 1 ) ) ) ) )

   cFile = "C:\Documents and Settings\dbrewer\Desktop\Test\Test2.pdf"
   cUrl = ConvertToUrl( cFile )
   oDoc.storeToUrl( cUrl,_
      Array(_
         MakePropertyValue( "FilterName", "writer_pdf_Export" ),_
         MakePropertyValue( "FilterData",_
            Array(_
               MakePropertyValue( "CompressionMode", 2 ) ) ) ) )
End Sub

Function MakePropertyValue( Optional cName As String, Optional uValue ) As com.sun.star.beans.PropertyValue
   oPropertyValue = createUnoStruct( "com.sun.star.beans.PropertyValue" )
   If Not IsMissing( cName ) Then
      oPropertyValue.Name = cName
   EndIf
   If Not IsMissing( uValue ) Then
      oPropertyValue.Value = uValue
   EndIf
   MakePropertyValue() = oPropertyValue
End Function


The file Test0.pdf turned out to be larger than Test1.pdf and Test2.pdf, which were both the same size.

I'm not sure if CompressionMode is the right property to use, or if I'm using it in the right way.

I'm looking at....
http://www.oooforum.org/forum/viewtopic.phtml?t=6769
http://www.oooforum.org/forum/viewtopic.phtml?p=31247#31247

I'm also trying this on OOo 1.1.4 on Win XP. I have SuSE 9.1 at home, not upgraded to 9.2 yet.
_________________
Want to make OOo Drawings like the colored flower design to the left?
Back to top
View user's profile Send private message
joeclark
General User
General User


Joined: 03 Feb 2004
Posts: 9

PostPosted: Mon Jan 31, 2005 7:33 pm    Post subject: Reply with quote

I have compared PDF output on Windows XP OOo 1.9.71.1 (and previous versions) for a short text document (no pictures), as compared with the output of PDFCreator, which acts as a printer driver but prints to a PDF file. The comparison surprises me.

OOo: ~92k PDF file
PDFCreator: ~20k PDF file

So OOo generates an identical-looking text PDF file that is more than 4x as large. I suppose it has something to do with the fonts that have been mentioned in this thread (my document uses Times New Roman), but I wonder why whatever trick PDFCreator uses can't be incorporated into OOo. I think doing so would make a lot of people happier with the PDF output (even if they don't realize it at the moment).
Back to top
View user's profile Send private message
hol.sten
Super User
Super User


Joined: 14 Nov 2004
Posts: 3532
Location: Hamburg, Germany

PostPosted: Mon Jan 31, 2005 11:46 pm    Post subject: Reply with quote

joeclark wrote:
I have compared PDF output on Windows XP OOo 1.9.71.1 (and previous versions) for a short text document (no pictures), as compared with the output of PDFCreator, which acts as a printer driver but prints to a PDF file. The comparison surprises me.

OOo: ~92k PDF file
PDFCreator: ~20k PDF file

Take a look at the fonts of the PDFCreator PDF document with "pdffonts". I think you will see, as you presumed, that PDFCreator doesn't embed the fonts.

joeclark wrote:
So OOo generates an identical-looking text PDF file that is more than 4x as large.

Try using a not commonly used font as Arial, Courier and Times. I think that the PDFCreator PDF will be equaly in size to the OOo PDF or different-looking.

joeclark wrote:
I suppose it has something to do with the fonts that have been mentioned in this thread (my document uses Times New Roman),

I suppose that also.

joeclark wrote:
but I wonder why whatever trick PDFCreator uses can't be incorporated into OOo. I think doing so would make a lot of people happier with the PDF output (even if they don't realize it at the moment).

Not including fonts may result in worse looking documents. So I think it's not a trick of PDFCreator.

With kind regards
hol.sten
Back to top
View user's profile Send private message
nubeli
Newbie
Newbie


Joined: 17 Feb 2005
Posts: 2

PostPosted: Thu Feb 17, 2005 10:26 am    Post subject: some interesting results Reply with quote

I'm working on a Windows machine (I use Linux at home and I might compare again). I've tried a few different configurations of exporting pdfs using OOo 1.9.74, pdfcreator, MS Word, Adobe Acrobat Pro. I have a 1 page document, no images, three fonts (Bookman Old Style, Times New Romans, Arial), and a couple tables. All configs produced nice-looking pdfs (my least favorite was Adobe's however).

It looks like pdfcreator is the real winner here in terms of file size and configurability. The real hog seems to be OOo export to pdf - I can't see any reason for the file to be so huge even if compression is off and all fonts are embeded. The help files say that OOo 2.0 will give config options for exporting pdf from the menu, but it doesn't come up.

file.pdf -- OOo export to pdf --- 138kb
file.pdf -- pdfcreator (with compression and embed all fonts) thru OOo --- 19kb
file.pdf -- pdfcreator (no compression, embed all fonts) thru OOo --- 34kb
file.pdf -- pdfcreator (compression, no fonts) thru OOo -- 8kb
file.pdf -- adobe acrobat pro thru word --- 76kb
file.pdf -- pdfcreator (compression, embed all fonts) --- 18kb

I haven't tested to see if pdfcreator really embeds all the fonts, but it turning off embed all fonts drastically decreases the size so it must be working. Even without compression and all fonts embedded the file is half of Adobe's and less than a quarter of OOo's export pdf!!
_________________
-------
herb
Back to top
View user's profile Send private message
hol.sten
Super User
Super User


Joined: 14 Nov 2004
Posts: 3532
Location: Hamburg, Germany

PostPosted: Thu Feb 17, 2005 12:37 pm    Post subject: Re: some interesting results Reply with quote

nubeli wrote:
I'm working on a Windows machine...

file.pdf -- OOo export to pdf --- 138kb
file.pdf -- pdfcreator (with compression and embed all fonts) thru OOo --- 19kb
file.pdf -- pdfcreator (no compression, embed all fonts) thru OOo --- 34kb
file.pdf -- pdfcreator (compression, no fonts) thru OOo -- 8kb
file.pdf -- adobe acrobat pro thru word --- 76kb
file.pdf -- pdfcreator (compression, embed all fonts) --- 18kb

I haven't tested to see if pdfcreator really embeds all the fonts

Take a look here: http://www.oooforum.org/forum/viewtopic.phtml?t=16042&highlight=pdffonts

You can see, that OOo, at least on Linux, isn't embedding Times-Roman and Symbol. And in this thread you can see, that OOo wouldn't embed Helvetica.

I think that pdfcreator doesn't embed Times-New-Roman (which is similar to Times-Roman) and Arial (which is similar to Helvetica) on a Windows system. pdfcreator perhaps knews that they are similar. And because OOo embeds them, the pdf size of OOo is much bigger. Take a look at your files with pdffonts. That would be interesting.

Is it possible that you make another competition with different fonts. With really unpopular fonts? I think that the difference wouldn't be that large. It would also be interesting to compare the results on different operating systems. At least OOo can do that...

With kind regards
hol.sten
Back to top
View user's profile Send private message
hol.sten
Super User
Super User


Joined: 14 Nov 2004
Posts: 3532
Location: Hamburg, Germany

PostPosted: Thu Feb 17, 2005 1:16 pm    Post subject: Re: some interesting results Reply with quote

nubeli wrote:
It looks like pdfcreator is the real winner here in terms of file size and configurability.

I made a competition too:
- Operating system: Windows XP
- Document: One page with a table and a lot of text
- Used fonts: Centennial and Frutiger
- Images: None
- Competitors: OOo 1.1.4, OOo 1.9.77, PDFCreator 0.8.0

Output
- OOo 1.1.4: Size 51 KByte
- OOo 1.9.77: Size 51 KByte
- PDFCreator 0.8.0 with compression and subset font embedding: Size 48 KByte
- PDFCreator 0.8.0 without compression and subset font embedding: Size 69 KByte
- PDFCreator 0.8.0 with compression and no font embedding: Size 11 KByte and not readable
- PDFCreator 0.8.0 without compression and no font embedding: Size 32 KByte and not readable

Result
- No difference in size between OOo 1.1.4 and 1.9.77
- The difference in size between OOo and PDFCreator is small, if both use compression and subset font embedding.
- The pdf documents of PDFCreator without font embedding are absolute unreadable. Every character is reduced to a dot. That's all. So it's a must to embed this fonts.

For me the winner is OOo:
- Using the same settings the file size is nearly equal
- The configurability of PDFCreator is useless, because only the settings with compression and with subset font embedding are useable
- Only OOo can export the pdf documents on Windows, Linux, Solaris etc.

With kind regards
hol.sten
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Writer All times are GMT - 8 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group