Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Angular] TypeScript errors when handling the onRenderHeader and onRenderQuestion functions as shown in the "Customize PDF Forms" demo #362

Open
JaneSjs opened this issue Jan 28, 2025 · 0 comments
Assignees
Labels
user issue An issue or bug reported by users.

Comments

@JaneSjs
Copy link
Contributor

JaneSjs commented Jan 28, 2025

T21600 - Request to Update Demo [Customize Your PDF Forms - Paper Form Builder for JavaScript] with Latest SurveyJS Version
https://surveyjs.answerdesk.io/internal/ticket/details/T21600


The following TS errors are thrown when trying to handle the onRenderQuestion function as demonstrated at Customize PDF Forms
Please refer to the following demo:

customize-pdf-forms.zip

Error: src/app/app.component.ts:152:42 - error TS2445: Property 'packs' is protected and only accessible within class 'DrawCanvas' and its subclasses.

152             const unfoldedPacks = canvas.packs[0].unfold();
                                             ~~~~~


Error: src/app/app.component.ts:154:44 - error TS2339: Property 'textColor' does not exist on type 'IPdfBrick'.

154             unfoldedPacks.forEach(el => el.textColor = "#00008b");
                                               ~~~~~~~~~


Error: src/app/app.component.ts:156:53 - error TS2339: Property 'color' does not exist on type 'IPdfBrick'.

156             unfoldedPacks[unfoldedPacks.length - 1].color = "gray";
                                                        ~~~~~


Error: src/app/app.component.ts:162:17 - error TS2322: Type '"right"' is not assignable to type 'HorizontalAlign | undefined'.

162                 horizontalAlign: 'right',
                    ~~~~~~~~~~~~~~~

  node_modules/survey-pdf/survey.pdf.d.ts:899:9
    899         horizontalAlign?: HorizontalAlign;
                ~~~~~~~~~~~~~~~
    The expected type comes from property 'horizontalAlign' which is declared here on type 'IDrawImageOptions'


Error: src/app/app.component.ts:174:43 - error TS2339: Property 'textColor' does not exist on type 'IPdfBrick'.

174             options.bricks[0].unfold()[0].textColor = "blue";
                                              ~~~~~~~~~


Error: src/app/app.component.ts:177:53 - error TS2339: Property 'color' does not exist on type 'IPdfBrick'.

177             lastRowBricks[lastRowBricks.length - 1].color = "gray";
                                                        ~~~~~


Error: src/app/app.component.ts:180:17 - error TS2794: Expected 1 arguments, but got 0. Did you forget to include 'void' in your type argument to 'Promise'?        

180                 resolve();
                    ~~~~~~~~~

  node_modules/typescript/lib/lib.es2015.promise.d.ts:33:34
    33     new <T>(executor: (resolve: (value: T | PromiseLike<T>) => void, reject: (reason?: any) => void) => void): Promise<T>;
                                        ~~~~~~~~~~~~~~~~~~~~~~~~~
    An argument for 'value' was not provided.
@JaneSjs JaneSjs added the user issue An issue or bug reported by users. label Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
user issue An issue or bug reported by users.
Projects
None yet
Development

No branches or pull requests

2 participants