monperrus / ExpandAnimations

LibreOffice/OpenOffice.org extension to expand animations before exporting to PDF. Looking for maintainers.
https://github.com/monperrus/ExpandAnimations
GNU Lesser General Public License v3.0
235 stars 31 forks source link

"Slide Count" field is arbitrarily added while exporting #50

Open ebobferraris opened 4 years ago

ebobferraris commented 4 years ago

Using a Master with the only "Slide Number" field, exported pdf contains "Slide Number / Slide Count" (see screenshot). Is it an intended behavior? Is it possible to disable? Screenshot from 2020-10-09 23-48-26

monperrus commented 4 years ago

thanks for the feedback, it is not possible to disable this.

sagitta42 commented 2 years ago

Same here. Would prefer if it wasn't there and showed just my original slide number N times, same as if I was in presentation mode.

Sbozzolo commented 1 year ago

This improved my situation: I edited the source code (Tools->Macros->Edit Macro) to comment out lines 140-142

'if slide.IsPageNumberVisible then
        'fixateSlideNumber(doc, slide, i+1, numSlides)
'end if

Now the style is correct (but the number is not).

NeverGameStar commented 9 months ago

This improved my situation: I edited the source code (Tools->Macros->Edit Macro) to comment out lines 140-142

'if slide.IsPageNumberVisible then
        'fixateSlideNumber(doc, slide, i+1, numSlides)
'end if

Now the style is correct (but the number is not).

Alternatively, you can change the style manually in the fixateSlideNumber function. I did so like this:

if shapeType = "com.sun.star.presentation.SlideNumberShape" then
            copy = doc.createInstance("com.sun.star.drawing.TextShape")
            'Call Tools.WritedbgInfo(shape)
            slide.IsPageNumberVisible = False
            slide.add(copy)
            copy.setString(CStr(slideNr)) '& " / " & CStr(slideCount))
            copy.Style = shape.Style
            copy.Text.Style = shape.Text.Style
            copy.Text.CharHeight = shape.Text.CharHeight
            copy.Text.CharFontFamily = shape.Text.CharFontFamily
            'copy.Text.CharFontName = shape.Text.CharFontName
            copy.Text.CharFontName = "Arial"
            'copy.Text.CharColor = shape.Text.CharColor
            copy.Text.CharColor = RGB(255, 255, 255)
            copy.Position = shape.Position
            copy.Size = shape.Size
            copy.TextVerticalAdjust = shape.TextVerticalAdjust
            copy.TextHorizontalAdjust = com.sun.star.drawing.TextHorizontalAdjust.CENTER
        end if

For some reason, it didn't really get the styles of the master file page number correctly - so I just hardcoded it in there. Now it works for me (position is still slightly lower, but I don't care at this point).

tomtom1-4 commented 2 months ago

Of this is not optimal. But I just changed numSlides in line 140 to the correct number manually.