File attachments are not working when pdf is loaded using Buffer

Hi,
Thanks it works with the sample, I’ll check with actual project and update you.
Also can you please suggest solution for the other issue where nested layers are not working properly also we can’t see the titles for that.
You can use the same sample project for verification, all you need to do is replace the attachmentsUrl with layerSampleUrl

Select layers options from menu

Below is the sample screenshot

Hi, I’m able to reproduce this issue, at the moment the viewer does not support nested layers. We can fix it so that the empty items don’t show up. What’s your timeline on this item? Thanks.

Hi, if you update to snapshot build 9.0.3-beta09, the invalid layers are not removed. Could you please update and give it a try? Thanks.

Sure thanks, I will update to that version and check.
To answer your previous question we need to have the nested layers support ASAP

Hi,

Could you please let us know what is your release timeline?
And is the lack of this feature blocking for you?

Best regards,
Saeed

Hi, tried to update lib version to 9.0.3-beta09 but seem that version is available for adding as dependency, following is the error I can see
Could not resolve com.pdftron:tools:9.0.3-beta09

Hi Team,

We are expecting nested layers to support by 31st Aug 2021

Hi,

In order to use the 9.0.3-beta09 snapshot build you will need to point maven to the snapshot repository as outlined here:

Can you please verify that the maven URL is set to snapshot? Thanks

 maven {
        // Change to snapshot Maven repository
        url "https://pdftron-maven.s3.amazonaws.com/snapshot"
    }

We are aware of your timeline regarding this feature, and will attempt to deliver to you as soon as possible.

Best Regards,
Andrew

Hi, the feature request came in Aug 20, unfortunately it is not possible for us to release this feature by Aug 31. If you need it so urgently, it is possible you could implement this on your side using PDFTron core API. Otherwise we will try to schedule it in next month release (not the upcoming one, but the one after that). Could you let us know what you think?

Hi,
We need this ASAP, could you please include this as part of next realease.
Meanwhile please share any sample code which demonstrate the use of core API’s to achieve these.

Hi,

You can call the following code snippet to traverse the layers in the document:

    public static void handleLayers(@NonNull PDFDoc pdfDoc) throws PDFNetException {
        Config config = pdfDoc.getOCGConfig();
        Obj order = config.getOrder();
        if (order != null) {
            for (int i = 0; i < order.size(); i++) {
                handleGroup(order.getAt(i));
            }
        }
    }

    private static void handleGroup(Obj group) throws PDFNetException {
        if (group.isArray()) { // it is an array of dicts or an array of arrays...
            Obj wl = group.getAt(0);
            Group ocg = new Group(wl);

            if (ocg.isValid()) { // if the array itself is an array of OCGs
                long sz = group.size();
                for (int x = 0; x < sz; x++) {
                    handleGroup(group.getAt(x)); // handle the sublayers
                }
            } else { // handle array
                Log.d("handleGroup", "Group name = " + wl.getAsPDFText());// 0 is the Name of the group
                long sz = group.size();
                for (int x = 1; x < sz; x++) {
                    handleGroup(group.getAt(x)); // handle the sublayers
                }
            }
        } else if (group.isDict()) { // it is a normal ocg, handle it
            Group ocg = new Group(group);
            Log.d("handleGroup", "Group name = " + ocg.getName());// 0 is the Name of the group
        }
    }

Additionally there are a number of helper methods in the PdfLayerUtils class that will help with layer states.

Currently the team is working on adding nested layers to the PDFTron Android SDK and as mentioned previously we will try to schedule it for the next month’s release. We can also update you with a snapshot version to try out when this feature is ready.

Hi Team,

As per our earlier discussion this issue was planned to fixed in next release, any update on next release.

Hi,

We are expecting this to be released in roughly two weeks, but we could provide a snapshot build prior to that if you desire. Please let us know if this is required.

Thanks
Andrew

Thanks for the update,

Please provide the snapshot, we will try to verify once.

Hi, please find a snapshot build with nested OCG here using version 9.1.1-alpha10 of snapshot build.

Direct link for the download package if you want to run sample instead:
https://nightly-pdftron.s3-us-west-2.amazonaws.com/experimental/2021-10-08/PDFNetAndroid_2021-10-08_experimental.zip

This would be a dev build not suitable for production.
Please let us know how it works for you. Thanks.

Hi Team,

I still see the issue. Please verify with attached pdf, try to open this pdf in Acrobat and try with pdftron. you will see the difference
pdf_layer_new.pdf (117.5 KB)

Hi,

To see the layers you will need to use the new layerDialog class: PdfLayerDialogFragment

Your document should show this when using that layer class:

Thanks,
Andrew

Hi Andrew,

Thanks for the update and it did work as expected, thanks a lot for the solution. May I know is this feature is available in release versions, if so please provide the SDK version as we are currently using 9.0.1

Hi, nested OCG layer is released in 9.1.1:

Please update to this release to enjoy the new feature.
Thanks.

Thanks for the confirmation and support