Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Tue Dec 03, 2019 9:57 am

Hi

I am trying to load a pdf and remove layers from it. I use the code below.

The layer is removed from the layers panel but the layer content still mains visible on the page.

Code: Select all

doc.Layers.RemoveLayer("LIMITS",true);
         

license.manager
 
Posts: 12
Joined: Thu Jul 09, 2015 11:07 am

Tue Dec 03, 2019 10:30 am

Hi,

Thanks for your inquiry.
To help us investigate your issue accurately, please offer us your input Pdf file.
You could upload it here or send us([email protected]) via email.

Best wishes,
Amber
E-iceblue support team
User avatar

Amber.Gu
 
Posts: 525
Joined: Tue Jun 04, 2019 3:16 am

Tue Dec 03, 2019 11:16 am

unable to send as confidential file but complete code below if it helps. I updated to lateset version and hotfix also.

Code: Select all
            PdfDocument doc = new PdfDocument();

            string virtualFolder1 = "~/content/templatefiles/";
            string physicalFolder1 = System.Web.HttpContext.Current.Server.MapPath(virtualFolder1);

            string NewFileName1 = physicalFolder1 + "\\CAD.pdf";

            doc.LoadFromFile(NewFileName1);


            string[] layerNames = new string[] { "LIMITS", "HYD", "HYDLINE" };


            for (int i = 0; i < doc.Layers.Count; i++)
            {

                if (layerNames.Contains(doc.Layers[i].Name))
                {
                    doc.Layers.RemoveLayer(doc.Layers[i], true);
                }
            }

            string virtualFolder = "~/temp/";
            string physicalFolder = System.Web.HttpContext.Current.Server.MapPath(virtualFolder);
            string FileID = Guid.NewGuid().ToString();
            string NewFileName = physicalFolder + "\\temp_" + FileID + ".pdf";


            doc.SaveToFile(NewFileName);

            doc.SaveToHttpResponse(NewFileName, System.Web.HttpContext.Current.Response, HttpReadType.Open);

            doc.Dispose();

            return NewFileName;

license.manager
 
Posts: 12
Joined: Thu Jul 09, 2015 11:07 am

Wed Dec 04, 2019 3:13 am

Hi,

Thanks for your reply.
I made an initial test and did notice the issue you mentioned. I have posted this issue to our Dev team and will let you know once it is fixed. Since the structure of each document is unique, to help us record your issue and solve your issue accurately, could you please offer us your input Pdf file?
You could upload it here or send us([email protected]) via email.

We promise to keep your file confidential and you could remove the sensitive information as long as your issue could still be reproduced.

Best wishes,
Amber
E-iceblue support team
User avatar

Amber.Gu
 
Posts: 525
Joined: Tue Jun 04, 2019 3:16 am

Fri Dec 06, 2019 11:56 am

I noticed same issue reported in August 2018 in post below. Any idea when will be fixed?

post27573.html?hilit=layers#p27573

license.manager
 
Posts: 12
Joined: Thu Jul 09, 2015 11:07 am

Mon Dec 09, 2019 10:51 am

Hi,

Thanks for your reply.
About the issue in the link you mentioned, it has not been resolved yet because of the complex structure of the document.

Besides, I noticed the issue with my testing file and logged it into our bug system before, and it is in the testing phrase now. Once the test passes, we will provide a hotfix for you ASAP.
However, since the structure of each document is unique, we couldn't guarantee that your issue could be resolved. You'd better to provide us your input Pdf file. You could upload it here or send us([email protected]) via email.

We promise to keep your file confidential and you could remove the sensitive information as long as your issue could still be reproduced.

Best wishes,
Amber
E-iceblue support team
User avatar

Amber.Gu
 
Posts: 525
Joined: Tue Jun 04, 2019 3:16 am

Fri Dec 13, 2019 10:58 am

Hi,

Hope you are doing well.
Glad to tell you that the previous issue has been resolved in Spire.Office_4.12.5, and we have compiled a temporary version for you, please download and test it from the following link. http://www.e-iceblue.com/downloads/TempVersion/spire.office_4.12.5.zip

Best wishes,
Amber
E-iceblue support team
User avatar

Amber.Gu
 
Posts: 525
Joined: Tue Jun 04, 2019 3:16 am

Mon Dec 16, 2019 10:43 am

Hi,

Hope you are doing well.
Glad to inform you that the previous issue has been resolved in Spire.PDF Pack(Hot Fix) Version:5.12.15. Welcome to download and test it from the following links.
Our website link:https://www.e-iceblue.com/Download/download-pdf-for-net-now.html
NuGet link: https://www.nuget.org/packages/Spire.PDF/5.12.15

Best wishes,
Amber
E-iceblue support team
User avatar

Amber.Gu
 
Posts: 525
Joined: Tue Jun 04, 2019 3:16 am

Wed Dec 25, 2019 8:18 am

Hi,

Greetings from E-iceblue.
Have you tried Spire.PDF Pack(Hot Fix) Version:5.12.15? Does it solve your issue?
Could you please give us some feedback at your convenience?

Best wishes,
Amber
E-iceblue support team
User avatar

Amber.Gu
 
Posts: 525
Joined: Tue Jun 04, 2019 3:16 am

Return to Spire.PDF