Locking is not working as expected

Hello Aspose Team

Sorry to say that aspose slide Locking is not working as expected

We have tried code from
http://www.aspose.com/docs/display/slidesnet/Applying+Protection+to+Presentation
but it can be easily unlocked. :frowning:
just copy any text from somewhere and paste it on locked slides (we tried shortcut for pasting CRTL +V)
you can see it will get unlocked please try

Awaiting Reply
Site is going live this week

Thanking you
Praveen

Hi Praveen,

I have observed your comments and request you to please share a working sample project (not complete on but reproducing the issue) in which you are applying locks and creating a unlocked slide using Ctrl+V in a new presentation instance. Please also share the created presentation as well. I will investigate this on my end to help you further.

Many Thanks,

this is the code we tried

Please find attachment for unlocked PPTX

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Aspose.Slides;
using Aspose.Slides.Charts;

namespace SlideLocking
{
    class Program
    {
        static void Main(string[] args)
        {
            Presentation pres = new Presentation("..\\..\\sample.pptx");
            foreach (ISlide slide in pres.Slides)
            {
                //ISlide object for accessing the slides in the presentation
                //IShape object for holding temporary shapes
                IShape shape;
                for (int count = 0; count < slide.Shapes.Count; count++)
                {
                    shape = slide.Shapes[count];

                    //if shape is autoshape
                    if (shape is IAutoShape)
                    {
                        //Type casting to Auto shape and getting auto shape lock
                        IAutoShape Ashp = shape as IAutoShape;
                        IAutoShapeLock AutoShapeLock = Ashp.ShapeLock;

                        //Applying shapes locks
                        AutoShapeLock.PositionLocked = true;
                        AutoShapeLock.SelectLocked = true;
                        AutoShapeLock.SizeLocked = true;
                    }
                    //if shape is group shape
                    else if (shape is IGroupShape)
                    {
                        //Type casting to group shape and getting group shape lock
                        IGroupShape Group = shape as IGroupShape;
                        IGroupShapeLock groupShapeLock = Group.ShapeLock;

                        //Applying shapes locks
                        groupShapeLock.GroupingLocked = true;
                        groupShapeLock.PositionLocked = true;
                        groupShapeLock.SelectLocked = true;
                        groupShapeLock.SizeLocked = true;
                    }
                    else if (shape is IGraphicalObject)
                    {
                        //lock chart
                        IGraphicalObject chart = shape as IGraphicalObject;
                        chart.ShapeLock.PositionLocked = true;
                        chart.ShapeLock.SelectLocked = true;
                        chart.ShapeLock.SizeLocked = true;
                    }
                    //if shape is a connector
                    else if (shape is IConnector)
                    {
                        //Type casting to connector shape and getting connector shape lock
                        IConnector Conn = shape as IConnector;
                        IConnectorLock ConnLock = Conn.ShapeLock;

                        //Applying shapes locks
                        ConnLock.PositionMove = true;
                        ConnLock.SelectLocked = true;
                        ConnLock.SizeLocked = true;
                    }
                    //if shape is picture frame
                    else if (shape is IPictureFrame)
                    {
                        //Type casting to pitcture frame shape and getting picture frame shape lock
                        IPictureFrame Pic = shape as IPictureFrame;
                        IPictureFrameLock PicLock = Pic.ShapeLock;

                        //Applying shapes locks
                        PicLock.PositionLocked = true;
                        PicLock.SelectLocked = true;
                        PicLock.SizeLocked = true;
                    }
                    else if (shape is ITable)
                    {
                        //lock table
                        ITable table = shape as ITable;
                        table.ShapeLock.PositionLocked = true;
                        table.ShapeLock.SelectLocked = true;
                        table.ShapeLock.SizeLocked = true;
                    }
                    else if (shape is IChart)
                    {
                        //lock chart
                        IChart chart = shape as IChart;
                        chart.ShapeLock.PositionLocked = true;
                        chart.ShapeLock.SelectLocked = true;
                        chart.ShapeLock.SizeLocked = true;
                    }
                    else
                    {
                    }
                }
            }

            pres.Save("..\\..\\output.pptx", Aspose.Slides.Export.SaveFormat.Pptx);
        }
    }
}

Hi Praveen,

I have observed the sample code and source presentation. The generated presentation locks all the slide shapes and they remain intact even if you copy slide with locked shapes to another presentation even. Your requirement that the when you copy paste the text from some where and paste on the slide on which shapes are locked then it is not going to ensure the addition in that slide. The concept is when you lock shapes on slide the locking ensures the integrity of those shapes only which locking is applied. There is no property of making the complete slide read only. However, you can set the complete presentation to ready only mode as it is done in PowerPoint. I hope this will clarify the concept to you. This is not an issue.

Many Thanks,

We bought Aspose.Net primarily for its locking feature.

We cannot make a presentation ‘read-only’ as it prompts for password/read-only confirmation during open, which is against our requirement specification.

In fact Aspose.Net locking is satisfactory except the following bug. So we expect this to get fixed.

  1. An Aspose.Net locked slide:

See the first attachment 1.png

  1. Copying text from a text editor:

See the second attachment 2.png

  1. Pasting text onto Aspose.Net locked slide

See the third attachment 3.png

  1. Pasted:

See the fourth attachment 4.png

  1. NOW, Locking lost!

See the fifth attachment 5.png

Requesting a fix for this.

Thanking you,

Praveen

Hi Praveeen,

I have observed the images shared by you and have tried modifying the locked presentation by copying text from text editor and directly pasting that on slide. There is no issue observed on my end and the shapes remain locked. I have used Aspose.Slides for .NET 15.4.0 on my end. For your kind reference, I have attached the source presentation as well as updated generated presentation. Can you please try opening the output presentation on your end. If you are still able to reproduce the issue then please share the complete PowerPoint version number used on your end.

Many Thanks,

Hello Mudassir,

We have tried the same output.pptx you provided.
yes we are still able to reproduce the issue ,
we are also using Aspose.Slide version 15.4.0

am attaching powerpoint details and unlocked presentation with this mail

Please check and comment

Hi Praveen,

Thank you for sharing the additional details with us. I have still not been able to reproduce this issue in PowerPoint 2010 version on my end. It seems to be an issue and I have created an issue with ID SLIDESNET-36497 to further investigate and resolve the issue. This thread has been linked with the issue so that you may be automatically notified once the issue will be resolved.

We are sorry for your inconvenience,

Hello

What about locking issue

this fix not included in the latest version of aspose.slides

but it was promised to include this fix in the last version aspose.slides

please comment

thanking you

Jinu

Hi Jinu,

Thank you for your interest in Aspose.Slides.

I have observed your comments and like to share that the issue SLIDESNET-36497 was logged into our issue management system in the last week of May and is pending for investigation at the moment. Please share with us the details when it was promised to be included in last version since it has not been scheduled for investigation yet. Our product team will investigate it on its due turn and we will share the good news with you once the issue will be resolved. We will appreciate your patience in this regard.

Best Regards,

what about the this issue

when we can expect a fix on this

Thanking you
Jinu

Hi Jinu,

I have observed your comments and like to share with you that the issue SLIDESNET-36497 is still pending for investigation. The product team is busy with the issues reported earlier. We will investigate and resolve this issue on its due turn. We will share the good news with you once the issue will be resolved. We really appreciate your patience in this regard.

Best Regards,

Please be kind enough to precisely tell me when will this issue be resolved?

Hi Jinu,

I have observed your comments and regret to share with you that this issue is still pending for investigation that is why we are unable to provide ETA for this issue. The issue will be investigated on its due turn. We really appreciate your patience in this regard.

Best Regards,

Hi Praveen,

I have discussed the issues status with our product team. At the moment the issue is unresolved. However, we have scheduled the issue for investigation during Week 34/2015. We will be able to share the further feedback with you in this regard after investigation will be completed by our product team. We will really appreciate your patience in this regard.

Many Thanks,

The issues you have found earlier (filed as SLIDESNET-36497) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

Hi Praveen,

Our product team has investigated the requirement on their end. Actually, there is the bug in PowerPoint that allows text to be edited in a locked shape. This bug exists consistently across PowerPoint 2013, 2010 and 2007.

The workaround is to create transparent rectangle and overlay it in front of the text box. Setup lock on the new rectangle shape. The text box should now not allow text editing. Please try using the following alternate on your end to serve the purpose.

IShape shape;
int shapesCount = slide.Shapes.Count;
for (int count = 0; count < shapesCount; count++)
{
    shape = slide.Shapes[count];

    if (shape is IAutoShape)
    {
        //Type casting to Auto shape and getting auto shape lock
        IAutoShape Ashp = shape as IAutoShape;
        IAutoShapeLock aShapeLock = Ashp.ShapeLock;
        aShapeLock.PositionLocked = true;
        aShapeLock.SelectLocked = true;
        aShapeLock.SizeLocked = true;

        //Workaround for text locking: create a transparent rectangle shape, overlay it in front of the text box and lock it
        IAutoShape transpRect = slide.Shapes.AddAutoShape(ShapeType.Rectangle, Ashp.X - 5, Ashp.Y - 5, Ashp.Width + 10, Ashp.Height + 10);
        transpRect.FillFormat.FillType = FillType.Solid;
        transpRect.FillFormat.SolidFillColor.Color = Color.Transparent;
        transpRect.LineFormat.FillFormat.FillType = FillType.NoFill;
        transpRect.ShapeLock.PositionLocked = true;
        transpRect.ShapeLock.SelectLocked = true;
        transpRect.ShapeLock.SizeLocked = true;

        //
    }
    ...
}

Many Thanks,