Ask Your Question

LibreOffice Draw slow with pdf

asked 2018-12-27 19:50:54 +0100

alex09 gravatar image

updated 2018-12-28 11:31:36 +0100

I am using a workstation with 32gb 2400mhz ram, Xeon 8th gen 4-core processor and very fast samsung SSD. I tried to open a 1 page PDF with Libreoffice Draw and it is so slow that it is almost unusable. Opening or saving the .odg document takes more than 5-6 seconds, moving around the page (via mouse or directional arrows) takes 1-2 seconds and it's extremely laggy. I tried to

  • put 2gb of Xmx and Xms memory in the java runtime environemnt
  • disable aliasing
  • increase caches size in Expert Configuration (basically x10 on each cache size and number of OLE objects)

the latter change made everything slightly faster but it is still terrible to use overall.

The page has 2 tables (built with lines), 2 small logos and some text.I tried to delete step by step the content and I reached some fluid navigation when I removed almost everything in the page but some text and lines.

This happens almost always when I open pdf files. Is there any known solution to avoid this or maybe removing some "buggy" components that slow everything down?

EDIT: sorry I forgot to add more details because in my mind I assumed it was experienced by everyone since it happened for as long as I can remember.

I have arch kernel 4.19.12-2 and it happens both with

  • libreoffice-fresh (bleeding edge version) 6.1.3-2
  • libreoffice-still (stable version) 6.0.7-2

The file I am having issue with can be found here

edit retag flag offensive close merge delete


Although you detail your amazing computer, you don't comment anything about the OS and LibreOffice version, and maybe if you share some of those slows pdf, maybe someone can find what the issue is.

m.a.riosv gravatar imagem.a.riosv ( 2018-12-27 22:36:17 +0100 )edit

1 Answer

Sort by » oldest newest most voted

answered 2018-12-28 13:24:09 +0100

JohnSUN gravatar image

First of all, I want to reassure you - this problem is not related to the configuration of your computer. On my computer, your file is also being processed very slowly.

You can easily understand such a strange behavior of the program, if you put a simple experiment. Select any element on the page (for example, a logo), press the Tab key and see what is highlighted when the focus is moved. It turns out that there are many graphic elements on the page that are not visible - their color almost coincides with the background color, the eye cannot see them, but the computer spends a lot of resources to draw it.


Continue the analysis, click F5 and turn on the display of shapes. Just on the first page of your document almost 4,500 objects.


This can happen if a document is created by some overly diligent OCR program.

How can you make a difference? For example, you can try to process a document with a macro like this:

Sub RemoveExcessTrash
Dim oDrawPages As Variant, oDrawPage As Variant, oElement As Variant
Dim i As Long, j As Long, nHeight As Long, nWidth As Long
Dim aSize As New
Dim sString As String
    oDrawPages = ThisComponent.getDrawPages()
    For i = oDrawPages.getCount()-1 To 0 Step -1
        oDrawPage = oDrawPages.getByIndex(i)
        For j = oDrawPage.getCount()-1 To 0 Step -1
            oElement = oDrawPage.getByIndex(j)
            aSize = oElement.getSize()
            nHeight = aSize.Height
            nWidth = aSize.Width
            sString = oElement.getString()
            If Trim(sString)="" And ((nHeight+nWidth < 1500) Or (nHeight*nWidth<6000)) Then oDrawPage.remove(oElement)
        Next j
    Next i
    Print "All done"
End Sub

This code just thoughtlessly removes all objects from the document that do not contain text and are not very large in size (the length of the half of perimeter and the size of area of ​​the figure are checked)

You will need to choose two constants empirically.

After such a rough processing, the document becomes not so heavy.

edit flag offensive delete link more


Thanks! I imagined it was something like that. I hoped there was some way to remove the aggressive OCR, but being able to visualize all those useless shapes is already good. Thanks

alex09 gravatar imagealex09 ( 2018-12-28 13:34:55 +0100 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2018-12-27 19:50:54 +0100

Seen: 42 times

Last updated: Dec 28 '18