Ask Your Question
0

Exported PDF 250% bigger

asked 2012-04-19 12:32:13 +0200

Jos oet Gebrook gravatar image Jos oet Gebrook
1 1

updated 2013-01-26 23:18:44 +0200

qubit gravatar image qubit flag of United States
5721 3 48 41

I have a Calc-file to make bills. The bill has te size of an A4 and in 3.4.4 the filesize is between 44 kB and 49 kB.

This morning I installed 3.5.2. Since then the bills have an filesize between 115kB and 125 kB.

I use a self made macro, so I'm sure I didn't do anything in another way.

Does anybody know the reason of this bigger filesize? For now, I downgraded LibreOffice back to 3.4.4.

The script:

sub export_pdf

  rem #----------------------------------------------------------------------
  rem # define variables
  dim document   as object
  dim dispatcher as object
  rem #----------------------------------------------------------------------
  rem # get access to the document
  document   = ThisComponent.CurrentController.Frame
  dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")

  rem #----------------------------------------------------------------------
  dim args1(0) as new com.sun.star.beans.PropertyValue
  args1(0).Name = "ToPoint"
  args1(0).Value = "$A$1:$G$50"

  dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args1())

  rem #----------------------------------------------------------------------
  dim args2(2) as new com.sun.star.beans.PropertyValue
  Dim Cel         As Object
  Dim Naam        As Object
  Dim Werkblad    As Object
  Dim Werkmap     As Object
  Dim Path        As Object
  Dim Jaar        As Object

  Werkmap=ThisComponent
  Werkblad=Werkmap.Sheets.getByName("Factuur")
  Cel=Werkblad.getCellByposition(6,10)  Rem# G11
  Jaar=Werkblad.getCellByposition(12,0) Rem# M1
  Naam=Werkblad.getCellByposition(2,9)  Rem# C10

  dim completefilenaam, Nieuwenaam
  completefilenaam=thiscomponent.url
  Rem#print completefilenaam

  if not globalscope.BasicLibraries.islibraryloaded("Tools") then
    Rem# Laad nu de library
    globalscope.BasicLibraries.loadlibrary("Tools")
  end if

  select case GetGUIType
    case 1 : Separator="/" Rem# Windows
    case 4 : Separator="/" Rem# Unix
    case else print "onbekend"
  end select


  args2(0).Name = "URL"
  args2(0).Value = tools.DirectoryNameOutOfPath(completefilenaam,Separator) &
                   "/facturen/"& Jaar.getString() & Separator &
                   Cel.getString()& "_" & Naam.getString() & ".pdf"
  args2(1).Name = "FilterName"
  args2(1).Value = "calc_pdf_Export"
  args2(2).Name = "FilterData"
  args2(2).Value = Array(
Array("UseLosslessCompression",0,false,com.sun.star.beans.PropertyState.DIRECT_VALUE),
Array("Quality",0,90,com.sun.star.beans.PropertyState.DIRECT_VALUE),
Array("ReduceImageResolution",0,false,com.sun.star.beans.PropertyState.DIRECT_VALUE),
Array("MaxImageResolution",0,300,com.sun.star.beans.PropertyState.DIRECT_VALUE),
Array("UseTaggedPDF",0,false,com.sun.star.beans.PropertyState.DIRECT_VALUE),
Array("SelectPdfVersion",0,0,com.sun.star.beans.PropertyState.DIRECT_VALUE),
Array("ExportNotes",0,false,com.sun.star.beans.PropertyState.DIRECT_VALUE),
Array("ExportBookmarks",0,true,com.sun.star.beans.PropertyState.DIRECT_VALUE),
Array("OpenBookmarkLevels",0,-1,com.sun.star.beans.PropertyState.DIRECT_VALUE),
Array("UseTransitionEffects",0,true,com.sun.star.beans.PropertyState.DIRECT_VALUE),
Array("IsSkipEmptyPages",0,true,com.sun.star.beans.PropertyState.DIRECT_VALUE),
Array("IsAddStream",0,false,com.sun.star.beans.PropertyState.DIRECT_VALUE),
Array("FormsType",0,0,com.sun.star.beans.PropertyState.DIRECT_VALUE),
Array("ExportFormFields",0,true,com.sun.star.beans.PropertyState.DIRECT_VALUE),
Array("HideViewerToolbar",0,false,com.sun.star.beans.PropertyState.DIRECT_VALUE),
Array("HideViewerMenubar",0,false,com.sun.star.beans.PropertyState.DIRECT_VALUE),
Array("HideViewerWindowControls",0,false,com.sun.star.beans.PropertyState.DIRECT_VALUE),
Array("ResizeWindowToInitialPage",0,false,com.sun.star.beans.PropertyState.DIRECT_VALUE),
Array("CenterWindow",0,false,com.sun.star.beans.PropertyState.DIRECT_VALUE),
Array("OpenInFullScreenMode",0,false,com.sun.star.beans.PropertyState.DIRECT_VALUE),
Array("DisplayPDFDocumentTitle",0,true,com.sun.star.beans.PropertyState.DIRECT_VALUE),
Array("InitialView",0,0,com.sun.star.beans.PropertyState.DIRECT_VALUE),
Array("Magnification",0,0,com.sun.star.beans.PropertyState.DIRECT_VALUE),
Array("Zoom",0,100,com.sun.star.beans.PropertyState.DIRECT_VALUE),
Array("PageLayout",0,0,com.sun.star.beans.PropertyState.DIRECT_VALUE),
Array("FirstPageOnLeft",0,false,com.sun.star.beans.PropertyState.DIRECT_VALUE),
Array("InitialPage",0,1,com.sun.star.beans.PropertyState.DIRECT_VALUE),
Array("Printing",0,2,com.sun.star.beans.PropertyState.DIRECT_VALUE),
Array("Changes",0,4,com.sun.star.beans.PropertyState.DIRECT_VALUE),
Array("EnableCopyingOfContent",0,true,com.sun.star.beans.PropertyState.DIRECT_VALUE),
Array("EnableTextAccessForAccessibilityTools",0,true,com.sun.star.beans.PropertyState.DIRECT_VALUE),
Array("ExportLinksRelativeFsys",0,false,com.sun.star.beans.PropertyState.DIRECT_VALUE),
Array("PDFViewSelection",0,0,com.sun.star.beans.PropertyState.DIRECT_VALUE),
Array("ConvertOOoTargetToPDFTarget",0,false,com.sun.star.beans.PropertyState.DIRECT_VALUE),
Array("ExportBookmarksToPDFDestination",0,false,com.sun.star.beans.PropertyState.DIRECT_VALUE),
Array("_OkButtonString",0,"",com.sun.star.beans.PropertyState.DIRECT_VALUE),Array("EncryptFile",0,false,com.sun.star.beans.PropertyState.DIRECT_VALUE),
Array("DocumentOpenPassword",0,"",com.sun.star.beans.PropertyState.DIRECT_VALUE),
Array("RestrictPermissions",0,false,com.sun.star.beans.PropertyState.DIRECT_VALUE),
Array("PermissionPassword",0,"",com.sun.star.beans.PropertyState.DIRECT_VALUE),
Array("Selection",0,,com.sun.star.beans.PropertyState.DIRECT_VALUE)
)

  dispatcher.executeDispatch(document, ".uno:DefinePrintArea", "", 0, args1())
  dispatcher.executeDispatch(document, ".uno:ExportToPDF", "", 0, args2())

  rem #----------------------------------------------------------------------
  dim args3(3) as new com.sun.star.beans.PropertyValue
  args3(0).Name = "ToPoint"
  args3(0).Value = "$I$7"

  dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args3())

end sub
delete close flag offensive retag edit

4 Answers

Sort by » oldest newest most voted
0

answered 2013-02-25 05:56:36 +0200

qubit gravatar image qubit flag of United States
5721 3 48 41

Hi @Jos oet Gebrook,

If you're still having a problem here, if none of the other Answers on this bug are providing a solution for you, and if installing the latest release doesn't seem to fix this problem...

... please file a bug and provide a list of steps that can reproduce it. The QA team will be happy to help you track down this issue!

Please post a link to any bugs you file in a comment below using the format "fdo#123456".

Thanks!

link delete flag offensive edit
1

answered 2012-04-26 02:40:45 +0200

mahfiaz gravatar image mahfiaz flag of Estonia
1801 18 17

updated 2012-05-03 21:34:08 +0200

Hey, could you provide example files as well? Then maybe someone can take a look.

link delete flag offensive edit
1

answered 2012-04-26 14:39:56 +0200

vojo gravatar image vojo
116 1 2 7

since LO export to PDF has the option to export to allow both LO editing and PDF viewing, it might be that the way your script is tasking LO, it is assume this combo format. For me, when combo turned on, PDF is 300% bigger than when off

link delete flag offensive edit
0

answered 2012-04-26 02:50:14 +0200

mariosv gravatar image mariosv flag of Spain
4719 20 46

Or verify if default values to export in Menu/File/Export to PDF are the same.

link delete flag offensive edit

Login/Signup to Answer

Donate

LibreOffice is made available by volunteers around the globe, backed by a charitable Foundation. Please support our efforts: Your donation helps us to deliver a better product!

Question tools

Follow
1 follower

subscribe to rss feed

Stats

Asked: 2012-04-19 12:32:13 +0200

Seen: 213 times

Last updated: Feb 25