Re: Special Characters - copyright

  •  10-31-2006, 7:56 AM

    Re: Special Characters - copyright

    Adam,
     
    Thanks for the response. I am trying to understand this issue, and honestly it feels like the behavor is a little buggy and defies a concise explination. I see there are others struggling to understand this special characters issue as well.
     
    When I fire the postback code here (hit the save changes button), the special character is either completely stripped out of the HTML by cute, or the characters are substituted for something else as described above. The behavior seems to be different depending on the font used (i.e standard vs. webdings).
     
    Here's the code:
     
    <script language="VB" runat="server">
     Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            If Page.IsPostBack Then
         
          Dim strSaveFilename as String
          Dim strPersonal as String
          'Dim strDate As Date
          'strDate = Today
          strSaveFilename = txtFileName.Text
          Session("ShortUploadedFileName") = strSaveFilename
          strPersonal = Session("UserID")
          'strSaveFileName = strSaveFileName + strDate
                   
        Editor1.SaveFile("../Templates/" + strSaveFileName) ' + strPersonal)
        Session("SaveFileName") = strSaveFileName ' + strPersonal
        
        MakePDF()
        UpdateDatabase()
        
      Else       
                'Put user code to initialize the page here
       txtFileName.Text = Session("DocumentName")
       Dim DocURL as String
       DocURL = "../Templates/" & Session("DocumentName")
                Editor1.LoadHtml(DocURL)      
            End If 
                   
            
        End Sub
     
     Sub MakePDF()
     
      'ActivePDF Code Here
           
        Dim strDirectory As String
        Dim strFileName As String
        Dim strSaveFilename as String
        strSaveFilename = txtFileName.Text
       
         strDirectory = "c:\inetpub\wwwroot\Templates"
         'strFileName = "HomestarPDFtest.pdf"
         strFileName = strSaveFileName + ".pdf" 'strPersonal + ".pdf"
         Session("NewPDF") = strFileName
         Session("PDFforFTP") = strDirectory + "\" + strFileName
         
        'Instatiate the Server object.
        Dim SVR As APServerNET.APServer
        SVR = New APServer
       
        'Instatiate the WebGrabber object.
        Dim WG As APWebGrbNET.APWebGrabber
        WG = New APWebGrabber
       
        ' Various settings
        Dim intTimeout As Integer = 30
        Dim strIP As String = "127.0.0.1"
        Dim strPort As String = "64320"
       
        ' Set Server properties
        SVR.OutputDirectory = strDirectory
        SVR.NewDocumentName = strFileName
        SVR.PDFTimeout = intTimeout
        SVR.PrintResolution = 600
        'SVR.PaperLength = 1008
        SVR.PaperSize = 5
     
        ' Set WebGrabber properties
        Dim InputURL As String
        InputURL = "file://c:/inetpub/wwwroot/templates/" + Session("SaveFileName")
        WG.URL = InputURL
        WG.EngineToUse = 1
        WG.Timeout = intTimeout
        WG.PrinterTimeout = intTimeout
       
        ' Must call before DoPrint to pass server settings to WG
        WG.Prt2DiskSettings = SVR.ToString()
       
        ' Start the conversion process
        Dim rtnDoPrint As Long = WG.DoPrint(strIP, strPort)
        If rtnDoPrint = 0 Then
         ' Wait for conversion result
         Dim rtnWait As String = WG.Wait(strIP, strPort, intTimeout, "")
         If rtnWait = "019" Then
          ' Wait is successfull
          lblStatus.Text = "Done!"
       
          ' Run WG CleanUp
          WG.CleanUp(strIP, strPort)
         Else
          ' Wait fails
          lblStatus.Text = "Wait Failed: " & rtnWait
          Exit Sub
          
         End If
        Else
         ' DoPrint fails
         lblStatus.Text = "DoPrint Failed: " & rtnDoPrint
         
        End If
       
        ' Clear Objects
        WG = Nothing
        SVR = Nothing
        
     End Sub
     Sub UpdateDatabase()
     
      Dim strUserType as String
      Dim dteCreationDate as Date
      Dim dteLastProductionDate as Date
      Dim strOwner as String
      Dim strImageID as String
      
      strUserType = "User"
      dteCreationDate = "1/11/1969"
      dteLastProductionDate = "1/11/2006"
      strOwner = "Roger Eddy"
      strImageID = "ThisWontWork"
       
      Dim mySQL As String = "INSERT INTO Documents (DocumentName, DocumentType, CreationDate, LastProductionDate, Owner, ImageID) Values('"
      mySQL = mySQL & Session("DocumentName") & "','" & strUserType & "','" & dteCreationDate & "','" & dteLastProductionDate & "','" & strOwner & "','" & strImageID & "')"
      Dim myCon As SqlConnection = New SqlConnection (ConfigurationSettings.AppSettings("DSN_dev"))
      Dim myCmd as SQLCommand = New SQLCommand(mySQL, myCon)
        
      Try
                myCon.Open()
                myCmd.ExecuteNonQuery()
       myCon.Close()
         
            Catch SQLexc As SqlException
                response.Write("Error while accessing Database.  Bad programmer, No Donut!  Error is " & SQLexc.ToString())
       lblStatus.Text = "Error is " & SQLexc.ToString()
       exit sub
            End Try
      
      Response.Redirect("Http://www.matrixworkflow.com/DP/CheckPDFOutput.aspx")
     
     End Sub
    </script>
     
     
    And
     
     
    <CE:Editor id="Editor1" Width="860" Height="750" DisableItemList="Save" DisableAutoFormatting="True" EditCompleteDocument="true" AllowPasteHtml="false" UseRelativeLinks="false" RemoveServerNamesFromUrl="false" ThemeType="Office2003_BlueTheme" AutoParseClasses="false" runat="server" ></CE:Editor>
     
    I am using the .NET 1.1 implementation.
     
     
    In the example you site above, are you doing a
     
    Editor1.SaveFile("../Templates/" + strSaveFileName) ' + strPersonal)
     
    or similar? This call is where the HTML is being changed.
     
    Any help would be appreciated, I am driving my users bonky trying to get this to work.
     
    Thanks in advance.
View Complete Thread