it was a problem in javascript stream


Public Sub AddJS3D(ByVal PgDest As Integer, ByVal StrScript As String)

        Dim pagedicFrom As PdfDictionary = New PdfDictionary
        pagedicFrom = _reader.GetPageN(PgDest)


        Dim oni As New PdfStream(PdfEncodings.ConvertToBytes(StrScript, ""))
        oni.FlateCompress()

        Dim annotarray As PdfArray = New PdfArray
        annotarray = PdfReader.GetPdfObject(pagedicFrom.Get(PdfName.ANNOTS))
        If Not (annotarray Is Nothing) Then
            Dim ArrayLen As Integer = annotarray.ArrayList.Count - 1
            For idx As Integer = 0 To ArrayLen
                If idx <= ArrayLen Then
                    Dim annotDic As PdfDictionary
                    annotDic =
PdfReader.GetPdfObjectRelease(annotarray.ArrayList(idx))
                    Dim sSubType As String =
annotDic.Get(PdfName.SUBTYPE).ToString
                    If (sSubType = "/3D") Then
                        Dim objP As PdfObject = Nothing
                        Dim DictP As PdfDictionary = Nothing

                        Dim Name3DD As New PdfName("3DD")
                        Dim Name_OnInstantiate As New
PdfName("OnInstantiate")

                        If annotDic.Contains(Name3DD) Then
                            objP = annotDic.Get(Name3DD)
                            If Not IsNothing(objP) Then
                                DictP = PdfReader.GetPdfObjectRelease(objP)
                            End If

                            Dim AnnotationCorretta As PdfDictionary
                            AnnotationCorretta =
PdfReader.GetPdfObjectRelease(DictP)
                            AnnotationCorretta.Remove(Name_OnInstantiate)
                            AnnotationCorretta.Put(Name_OnInstantiate,
_Dest.Writer.AddToBody(oni).IndirectReference())
                        End If
                    End If
                End If
            Next

        End If

    End Sub

--
View this message in context: 
http://itext-general.2136553.n4.nabble.com/Scrit-in-PDF3D-tp3444852p3449532.html
Sent from the iText - General mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Benefiting from Server Virtualization: Beyond Initial Workload 
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve 
application availability and disaster protection. Learn more about boosting 
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to