Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > get all word of slide through aspose.slide

Reply
Thread Tools

get all word of slide through aspose.slide

 
 
akshar108 via DotNetMonster.com
Guest
Posts: n/a
 
      10-30-2007
Hi,

I have aspose slide component and i want to take all string in the
presentation's all slide but that component not give any method to get that
direct we have to take all shape's textframe and then take text i do that
things and then count words but i not get true word count can any one say me
the technique to get that or give me any code for that my code is following

Try
Dim lic As Aspose.Slides.License = New Aspose.Slides.
License
lic.SetLicense(HttpContext.Current.Server.MapPath( "bin").
ToString + "\\" + "Aspose.Custom.lic")
Dim srcPres As Presentation = New Presentation(root)
Dim totalWords As Int64 = 0



For i As Integer = 1 To srcPres.Slides.LastSlidePosition

Dim srcSld As Slide = srcPres.GetSlideByPosition(i)

Dim thldText1 As String = srcSld.HeaderFooter.
HeaderText.Replace(vbCr, " ").Replace(vbLf, " ").Replace(vbVerticalTab, " ")

Dim splitParams1() As Char = {" "c}

Dim wordsInThisTextHolder1 As Integer = thldText1.
Split(splitParams1, StringSplitOptions.RemoveEmptyEntries).Length

totalWords += wordsInThisTextHolder1


Dim thldText2 As String = srcSld.HeaderFooter.
FooterText.Replace(vbCr, " ").Replace(vbLf, " ").Replace(vbVerticalTab, " ")

Dim splitParams2() As Char = {" "c}

Dim wordsInThisTextHolder2 As Integer = thldText2.
Split(splitParams2, StringSplitOptions.RemoveEmptyEntries).Length

totalWords += wordsInThisTextHolder2


If Not srcSld.Notes Is Nothing Then
Dim thldText3 As String = srcSld.Notes.Text.
Replace(vbCr, " ").Replace(vbLf, " ").Replace(vbVerticalTab, " ")

Dim splitParams3() As Char = {" "c}

Dim wordsInThisTextHolder3 As Integer = thldText2.
Split(splitParams3, StringSplitOptions.RemoveEmptyEntries).Length

totalWords += wordsInThisTextHolder3
End If

For Each shp As Shape In srcSld.Shapes



If Not shp.Placeholder Is Nothing Then

If TypeOf shp.Placeholder Is TextHolder Then

Dim thld As TextHolder = shp.Placeholder

Dim thldText As String = thld.Text.
Replace(vbCr, " ").Replace(vbLf, " ").Replace(vbVerticalTab, " ")


Dim splitParams() As Char = {" "c}

Dim wordsInThisTextHolder As Integer =
thldText.Split(splitParams, StringSplitOptions.RemoveEmptyEntries).Length

totalWords += wordsInThisTextHolder

Continue For

End If

End If

If TypeOf shp Is Aspose.Slides.Table Then
Dim dt As Aspose.Slides.Table = shp

For Each tShape As Aspose.Slides.Shape In dt.
Shapes
If tShape.TextFrame IsNot Nothing Then
Dim tfText As String = tShape.
TextFrame.Text.Replace(vbCr, " ").Replace(vbLf, " ").Replace(vbVerticalTab, "
")
Dim splitParams() As Char = {" "c}

Dim wordsInThisTextFrame As Integer =
tfText.Split(splitParams, StringSplitOptions.RemoveEmptyEntries).Length

totalWords += wordsInThisTextFrame
End If
Next
Continue For
End If

If TypeOf shp Is Aspose.Slides.Rectangle Then
Dim rect As Aspose.Slides.Rectangle = shp

If rect.TextFrame IsNot Nothing Then
Dim tfText As String = rect.TextFrame.
Text.Replace(vbCr, " ").Replace(vbLf, " ").Replace(vbVerticalTab, " ")
Dim splitParams() As Char = {" "c}

Dim wordsInThisTextFrame As Integer =
tfText.Split(splitParams, StringSplitOptions.RemoveEmptyEntries).Length

totalWords += wordsInThisTextFrame
End If

Continue For
End If

If TypeOf shp Is Aspose.Slides.GroupShape Then
Try

Dim shp1 As Aspose.Slides.Shape = shp

'NextGr:

Dim dt As Aspose.Slides.GroupShape = shp1

For Each tShape As Aspose.Slides.Shape In
dt.Shapes

If TypeOf tShape Is Aspose.Slides.
Rectangle Then

Dim trect As Aspose.Slides.
Rectangle = tShape

If Not trect.TextFrame Is Nothing
Then

Dim tf As TextFrame = trect.
TextFrame

If Not tf.Text Is Nothing
Then

Dim tfText As String = ""

tfText = tf.Text.Replace
(vbCr, " ").Replace(vbLf, " ").Replace(vbVerticalTab, " ")

Dim splitParams() As Char
= {" "c}

Dim wordsInThisTextFrame
As Integer = tfText.Split(splitParams, StringSplitOptions.RemoveEmptyEntries).
Length

totalWords +=
wordsInThisTextFrame
End If
End If
End If
If TypeOf tShape Is Aspose.Slides.
GroupShape Then

'totalWords += Group(tShape,
totalWords)
' shp1 = tShape

' GoTo NextGr

For Each tShape1 As Aspose.Slides.
Shape In dt.Shapes

If Not tShape1.TextFrame Is
Nothing Then
Dim tf As TextFrame =
tShape1.TextFrame

If Not tf.Text Is Nothing
Then

Dim tfText As String
= ""

tfText = tf.Text.
Replace(vbCr, " ").Replace(vbLf, " ").Replace(vbVerticalTab, " ")

Dim splitParams() As
Char = {" "c}

Dim
wordsInThisTextFrame As Integer = tfText.Split(splitParams,
StringSplitOptions.RemoveEmptyEntries).Length

totalWords +=
wordsInThisTextFrame
End If
End If
Next
Else
If Not tShape.TextFrame Is
Nothing Then
Dim tf As TextFrame = tShape.
TextFrame

If Not tf.Text Is Nothing
Then

Dim tfText As String = ""

tfText = tf.Text.Replace
(vbCr, " ").Replace(vbLf, " ").Replace(vbVerticalTab, " ")

Dim splitParams() As Char
= {" "c}

Dim wordsInThisTextFrame
As Integer = tfText.Split(splitParams, StringSplitOptions.RemoveEmptyEntries).
Length

totalWords +=
wordsInThisTextFrame
End If
End If

End If

Next

Continue For

Catch ex As Exception

End Try

--
Ashish Langhnoja
..Net Developer (IntelSoft Soutions Pvt. Ltd.)
Gujarat(India)

Message posted via DotNetMonster.com
http://www.dotnetmonster.com/Uwe/For...p-net/200710/1

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[ANN] Slide Show (S9) Gem V0.6 - New and Improved Support for UsingYour Own Slide Show Templates Gerald Bauer Ruby 0 08-26-2008 08:12 PM
Slide-in & slide-out Scroller Help! banyan Javascript 0 11-16-2005 08:05 AM
Good slide scanning service vs. good slide scanner for Do-It-Yourself? LAshooter Digital Photography 0 06-25-2005 07:14 AM
Still trying to get my head round 'slide show' options on a DVD player! Alan F Cross Digital Photography 5 09-19-2003 01:34 AM
What to get in a digital projector for digital slide shows? BG250 Digital Photography 4 08-16-2003 11:45 AM



Advertisments