Property 'getPathData' does not exist on type 'Element'

WebViewer Version: 8.5.0

Do you have an issue with a specific file(s)? no
Can you reproduce using one of our samples or online demos? not sure
Are you using the WebViewer server? no
Does the issue only happen on certain browsers? no
Is your issue related to a front-end framework? no
Is your issue related to annotations? no

Please give a brief summary of your issue:
getPathData does not exist on type Element (WebViewer)

Please describe your issue and provide steps to reproduce it:
I have run into an issue using WebViewer - it seems that getPathData is not part of the Element Class for the Web api, yet the api does have support for the PathSegmentType… is this a mistake? Why have the PathSegmentType but not have access to the pathData?

Please provide a link to a minimal sample where the issue is reproducible:
const page = await doc.getPage(0);

const reader = await PDFNet.ElementReader.create();

  await reader.beginOnPage(page);

  var element;
  while (element = await {	// Read page contents
    switch (await element.getType()) {
      case PDFNet.Element.Type.e_path:
        const data = await element.getPathData();
        // the above fails with error  "Property 'getPathData' does not exist on type 'Element'."

Please advise how to get the pathdata for web viewer

Hello, I’m Ron, an automated tech support bot :robot:

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:



Thank you for contacting us regarding WebViewer and reporting this issue! It looks like our TypeScript type declaration file is missing “getPathData”. You can add something like

         * Returns the PathData stored by the path element. Contains "points" and "operators"
         * @returns A promise that resolves to "PathData" object
        getPathData(): Promise<object>;

into the “lib/types.d.ts” file under “class Element”.

We’ll update our TypeScript definition so this doesn’t show up in the future. Feel free to let us know if you have issues adding the missing TypeScript or if you notice any other missing type definitions. Thank you

Best Regards,
Andrew Yip
Software Developer
PDFTron Systems, Inc.

Hi Andrew.
I have given this a try and it looks ok - thank you for your reply