What is layer for object?

  • nav3000

    nav3000 - 2013-02-01

    Dear community
    I try extract graphic and text objects from PDF-File, which has layers.
    how can I find out which layer an object belongs?
    thanks in advance for your answer

  • Stefano Chizzolini

    During content scanning through ContentScanner you can move up till you reach the (possibly) containing MarkedContent, checking whether its header's tag equals to PdfName.OC (which means it belongs to a layer, whose name is returned by the Properties property of the header).

  • nav3000

    nav3000 - 2013-02-04

    Dear, Stefano
    Thanks for your help. But I have second question for this thema.

    In my source code get I value of current PdfName. Now can I say, that one or other object there is in first, second or third etc.. layer

    string _currentLayer;
    org.PDFClown.documents.contents.ContentScanner level;
    org.PDFClown.objects.PdfName _currentPdfName;

    while (level.MoveNext())
    org.PDFClown.documents.contents.objects.ContentObject content = level.Current;
    if (content is org.PDFClown.documents.contents.objects.MarkedContent)
    org.PDFClown.objects.PdfName pn = ((content as org.PDFClown.documents.contents.objects.MarkedContent).Header.Operands[0] as org.PDFClown.objects.PdfName);

    ///My routine – here I extract geometrical and text objects


    Object of type org.PDFClown.documents.Document has Property Layer which contain layers. How can I find out which layer an _currentPdfName belongs?

    Sincerely yours


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks