Hi
I have implemented Aspose Slides for net in most recent version in a custom asp.net application where a preview for a ppt is shown to the visitor of a specific intranet page
I have implemented all this from the code that is in this forum and the docs and it works pretty good so far
There is just one issue that I have with the product:
In my presentation-template from which the final presentation is generated and data is inserted I have one text-placeholder which is filled with some text by the application depending on the users rights
This placeholder is formatted as a text-placeholder with 3 columns and with bullets.
The presentation is built correct with the bullets-lines using the three columns as specified
Just when we generate an thumb for this slide as described here:
Aspose.Slides for .NET|Aspose.Slides Documentation
the Image that is created is not correctly showing this area because it shows the bullets continuing vertically over the edge of the placeholder while the text-lines are correctly put in 3 columns (see attached image)
It seems there is something wrong with generating the preview, because the resulting Slide(pptx) looks correct
regards
Don
Hi Don,
Hi Mussadir
Thanks for looking at this
I have uploaded the slide Templaet as an attachement
The part of code where the slide is loaded and prefilled looks like that: Public Function GeneratePptxSlide(ByVal SLIDE As String, ByVal VDID As String, ByVal ReplaceText As String) As PresentationEx
Dim fis As System.IO.FileStream = New System.IO.FileStream(SLIDE, System.IO.FileMode.Open, System.IO.FileAccess.Read)
Dim pres As PresentationEx = New PresentationEx(fis)
fis.Close()
Dim sld As SlideEx = pres.Slides(0)
’ Iterate through shapes to find and replace the placeholders text
For Each shp As ShapeEx In sld.Shapes
If shp.Placeholder IsNot Nothing Then
If shp.Placeholder.Type = PlaceholderTypeEx.Body Then
If shp.AlternativeText = VDID then
CType(shp, AutoShapeEx).TextFrame.Text = ReplaceText
Exit For
End If
End If
End If
Next
Return ResultSlide
End Function
The part of code where the preview thumbs are generated is here: Public Sub BuildPreviewImages(ByVal SavePath As String, ByVal SourceFile As String, ByVal slideId as integer)
Dim fis As System.IO.FileStream = New System.IO.FileStream(SourceFile, System.IO.FileMode.Open, System.IO.FileAccess.Read)
Dim pres As PresentationEx = New PresentationEx(fis)
fis.Close()
’ generate temporary thumb for the slide
Dim sld As SlideEx = pres.Slides(slideId)
Dim SlideImg As System.Drawing.Bitmap = New System.Drawing.Bitmap(sld.GetThumbnail(1.20000005F, 1.20000005F))
Dim dpt = “C:/” & SavePath & slideId & “.jpg” ’ DirectoryPaTh
Dim upt = “http://xxxxxxxxx” & SavePath & slideId & “.jpg” ’ UrlPaTh
Try
SlideImg.Save(dpt, System.Drawing.Imaging.ImageFormat.Jpeg)
Catch ex As Exception
End Try
SlideImg.Dispose()
End Sub
As I mentioned before, this all works pretty good for any other template we use
Just this special case (3 columns format and Bullets in the text-placeholder)
thanks in advance for your help
Don
Hi Don,