Page 1 of 1

Flatten Comments

Posted: Tue Jul 05, 2016 2:45 pm
by jeffp
Is there a way to flatten comments/annotations using IPXC_Document?

Here's what I have so far.

Code: Select all

procedure TMyPDF.FlattenComments;
var
  i, j, APageCount, AAnnotCount: Cardinal;
  APage: IPXC_Page;
  A: IPXC_Annotation;
begin
  if Assigned(FDoc) then
  begin
    APageCount := GetPageCount;
    for i := 0 to APageCount - 1 do
    begin
      FDoc.Pages.Get_Item(i, APage);
      APage.GetAnnotsCount(AAnnotCount);
      for j := 0 to AAnnotCount - 1 do
      begin
        APage.GetAnnot(j, A);
        //How to do I flatten?
      end;
    end;
  end;
end;

Re: Flatten Comments

Posted: Wed Jul 06, 2016 2:41 pm
by Sasha - Tracker Dev Team
Hello Jeff,

The IPXC_Document::FlattenAnnotations method will be available from the next build. Meanwhile you can try the latest dev. build - this method will be included in it.
https://forum.pdf-xchange.com/ ... 66&t=25943

Cheers,
Alex

Re: Flatten Comments

Posted: Wed Jul 06, 2016 2:50 pm
by jeffp
Perfect. Thanks.

Any update on when the next official build will be released?

Re: Flatten Comments

Posted: Wed Jul 06, 2016 2:51 pm
by Sasha - Tracker Dev Team
Hello Jeff,

Sadly no - it should be out soon but no specific date is available yet.

Cheers,
Alex

Re: Flatten Comments

Posted: Tue Jul 26, 2016 4:43 pm
by jeffp
Any word on the new release?

Re: Flatten Comments

Posted: Tue Jul 26, 2016 5:59 pm
by Vasyl-Tracker Dev Team
Also in current release you may use Editor's operation:

https://sdkhelp.pdf-xchange.com/vie ... ts_flatten

Re: Flatten Comments

Posted: Tue Jul 26, 2016 7:43 pm
by jeffp
Thanks. That works.

But still waiting on next build for a few other items so curious to know if there is any work on the release date.

Re: Flatten Comments

Posted: Tue Jul 26, 2016 8:14 pm
by Paul - Tracker Supp
HI Jeff,

there is a great deal to do regards XFA still on 318 and at present we are looking at late August. As usual we reserve the right to change that as things develop.

I hope that helps.

Re: Flatten Comments

Posted: Wed Oct 26, 2016 8:49 pm
by jeffp
Ok. I see you've added IPXC_Document.FlattenAnnotations.

But I still can't figure out how to make it work. How do I fill the IPXC_AnnotsList?

See my code below.

Code: Select all

procedure TMyPDF.FlattenComments;
var
  i, APageCount: Cardinal;
  APage: IPXC_Page;
  AL: IPXC_AnnotsList;
begin
  if Assigned(FDoc) then
  begin
    APageCount := GetPageCount;
    for i := 0 to APageCount - 1 do
    begin
      FDoc.Pages.Get_Item(i, APage);

      //How to I Fill the IPXC_AnnotsList???
      FDoc.FlattenAnnotations(i, AL);
    end;
  end;
end;


Re: Flatten Comments

Posted: Thu Oct 27, 2016 12:39 am
by Vasyl-Tracker Dev Team
Hi Jeff.
How to I Fill the IPXC_AnnotsList???
I'm afraid but it is impossible currently to obtain IPXC_AnnotsList-object. We'll add such feature in our regular technical build, and in next official build too.

In next few days we will fix/improve couple moments related to FlattenAnnotations:

1. FlattenAnnotations(pageIndex, null) - all annotations on the <pageIndex> will be flattened
2. FlattenAnnotations(pageIndex, annotList) - all annotations specified in <annotList> will be flattened, you are able to put into <annotList> annots from different pages. the <pageIndex> argument will be ignored in this case.
3. FlattenAnnotations(-1, nullptr) - all existing annotations in document will be flattened

Additionally the new features will be added too:

1. IPXC_Page::GetAnnotsList(IPXC_AnnotsList**) - will return list of annotations on the page
2. IPXC_Inst::CreateAnnotsList(IPXC_AnnotsList**) - will return empty list. It might be used for building custom annot-list and the flatten all of them as well.

Please wait for upcoming technical/official build..

HTH

Re: Flatten Comments

Posted: Thu Oct 27, 2016 1:15 am
by jeffp
Ok. I can wait. Will it be build

318.2?

And when will it be out roughly?

Re: Flatten Comments

Posted: Thu Oct 27, 2016 1:20 am
by Vasyl-Tracker Dev Team
It will be 319, approximately at the end of November.

Tomorrow, in the morning, you will be able to try our technical build with such new stuffs..

Re: Flatten Comments

Posted: Thu Oct 27, 2016 4:06 am
by jeffp
Will

FlattenAnnotations(pageIndex, null)

work now. That is really what I need. I will always want to flatten all comments on a page.

Re: Flatten Comments

Posted: Thu Oct 27, 2016 5:17 am
by Sasha - Tracker Dev Team
Hello Jeff,

If it was a question - please try our Dev. Build available from here and check whether the problem was resolved:
https://www.pdf-xchange.com/forum3 ... 66&t=25943

Cheers,
Alex

Re: Flatten Comments

Posted: Thu Oct 27, 2016 4:07 pm
by Vasyl-Tracker Dev Team
FlattenAnnotations(pageIndex, null)
It is not working in current official build. Currently it working only in technical build.

Re: Flatten Comments  SOLVED

Posted: Thu Nov 17, 2016 4:19 pm
by jeffp
Finally, got the dev build and can confirm this issue is now fixed.

Re: Flatten Comments

Posted: Thu Nov 17, 2016 4:33 pm
by Tracker Supp-Stefan
:)

Re: Flatten Comments

Posted: Thu Sep 21, 2017 6:06 pm
by RMan
In trying this the comments were flattened but they were still listed in the Comments Pane in the Editor. Is there an event that needs to be fired to refresh the Comments Pane list?

I was able to flatten them all using this sample and that removed the listing in the comments pane also but it's not as clean of code.
https://sdkhelp.pdf-xchange.com/vie ... ts_flatten

Re: Flatten Comments

Posted: Sat Sep 23, 2017 7:28 am
by Sasha - Tracker Dev Team
Hello RMan,

It is better to use operations for the Editor SDK usage - they fire all of the events needed, fill the Undo\Redo data and do other things that you can be unaware of that are needed for proper Editor functionality. The operations take more code but they are safe for usage whilst the IPXC-level methods do not control the UI level and other events\methods should be fired\executed for the proper work.

Cheers,
Alex

Re: Flatten Comments

Posted: Sat Sep 23, 2017 12:18 pm
by RMan
The undo/redo reason makes sense and never even thought about that case. Thanks again.

Re: Flatten Comments

Posted: Sat Sep 23, 2017 12:20 pm
by Sasha - Tracker Dev Team
:)