DisplayName on op.attachments.add not working

PDF-XChange Editor SDK for Developers

Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan

Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.

When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
lidds
User
Posts: 510
Joined: Sat May 16, 2009 1:55 pm

DisplayName on op.attachments.add not working

Post by lidds »

I am using the following code to add attachments from my database to a document. The problem is, even though I am settings the attachment "DisplayName" it still displays the fileName?

Code: Select all

                Dim nID As Integer = Me.docPreview.Inst.Str2ID("op.attachments.add", False)
                Dim Op As PDFXEdit.IOperation = Me.docPreview.Inst.CreateOp(nID)
                Dim input As PDFXEdit.ICabNode = Op.Params.Root("Input")

                For Each myRow As DataRow In myResults.myDataset.Tables("Attachments").Rows
                    Try
                        input.Add().v = Me.docPreview.Doc

                        Dim options As PDFXEdit.ICabNode = Op.Params.Root("Options")
                        Dim destPath As PDFXEdit.IAFS_Name = fsInst.DefaultFileSys.StringToName(MISData.Instance.DocShareName & "\Attachments\" & myRow.Item("attachmentOID").ToString.ToUpper & "." & myRow.Item("fileExt").ToString.ToUpper)
                        options("FileName").v = destPath
                        Console.WriteLine(myRow.Item("fileName").ToString.ToUpper() & "." & myRow.Item("fileExt").ToString)
                        options("DisplayName").v = myRow.Item("fileName").ToString.ToUpper() & "." & myRow.Item("fileExt").ToString
                        options("MimeType").v = myRow.Item("fileType").ToString.ToUpper()
                        options("Description").v = myRow.Item("fileDesc").ToString.ToUpper
                        Op.Do()
                    Catch ex As Exception

                    End Try
                Next
Am I doing something wrong?

Thanks

Simon
lidds
User
Posts: 510
Joined: Sat May 16, 2009 1:55 pm

Re: DisplayName on op.attachments.add not working

Post by lidds »

I have also tried the following code in the FullDemo example and the same happens

Code: Select all

    private void btnAddAttachment_Click(object sender, EventArgs e)
    {
      try
      {
        int nID = this.pdfCtl.Inst.Str2ID("op.attachments.add", false);
        PDFXEdit.IOperation Op = this.pdfCtl.Inst.CreateOp(nID);
        PDFXEdit.ICabNode input = Op.Params.Root["Input"];

        try
        {
          input.Add().v = this.pdfCtl.Doc;

          PDFXEdit.ICabNode options = Op.Params.Root["Options"];
          PDFXEdit.IAFS_Name destPath = fsInst.DefaultFileSys.StringToName("D:\\Files\\Attachments\\44A92110-0E64-409D-8E1E-1CCFBCFFC9BC.DOC");
          options["FileName"].v = destPath;
          options["DisplayName"].v = "simon.doc";
          options["MimeType"].v = "APPLICATION/MSWORD";
          options["Description"].v = "My description";
          Op.Do();
        }
        catch (Exception ex)
        {

        }
      }
      catch (Exception ex)
      {
        Console.WriteLine(ex.Message);
      }
    }
lidds
User
Posts: 510
Joined: Sat May 16, 2009 1:55 pm

Re: DisplayName on op.attachments.add not working

Post by lidds »

A little bit more information, it seems that the "DisplayName" is being held, however the actual Attachments UI Grid displays the fileName not the DisplayName. Am I able to fix this somehow?

Thanks

Simon
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am

Re: DisplayName on op.attachments.add not working

Post by Sasha - Tracker Dev Team »

Hello Simon,

I've investigated and hopefully fixed this - this was an inner logic - the display name and the FileName were similar in all of the cases that they were used in the End-User Editor - thus this was not noticed. The fix will be available from the next build (end of June hopefully).

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
lidds
User
Posts: 510
Joined: Sat May 16, 2009 1:55 pm

Re: DisplayName on op.attachments.add not working

Post by lidds »

Thanks Alex, look forward to the new release.

Just out of interest is there a way to get an automatic notification when you release a new build?

Thanks

Simon
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am

Re: DisplayName on op.attachments.add not working

Post by Sasha - Tracker Dev Team »

Hello Simon,

The updater of the End-User Editor should give you a notification.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
lidds
User
Posts: 510
Joined: Sat May 16, 2009 1:55 pm

Re: DisplayName on op.attachments.add not working

Post by lidds »

Alex,

I don't have the End-User editor installed. Is there not a way to get notification through your website. I obviously have an account and license for the Editor SDK, should this not email me when you upload a new version?

If not I will install the end-user editor to achieve this.

Thanks

Simon
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am

Re: DisplayName on op.attachments.add not working

Post by Sasha - Tracker Dev Team »

Hello Simon,

We are not mailing this because this can be considered as spam for majority of people. What you can use for now is news on our website or the login popup messages that we display when you login to our website.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ