How to import html2canvas in angular 7.? - html2canvas

I am setting up a pdf download option in my angular 7 application. For that I need to import html2canvas. But it shows the error
Can not find module html2canvas
Here I am attaching my code below
import * as jsPDF from 'jspdf';
import * as html2canvas from 'html2canvas';

Related

How to click the menu item from the application using pywinauto

import pywinauto,time
from pywinauto import Application
from pywinauto.keyboard import send_keys
from pywinauto.controls.win32_controls import ButtonWrapper
from pywinauto import mouse
app = Application().start(cmd_line="C:\\Users\\6141\\Desktop\\eval\\32bit\\ProSeriesLauncher.exe")
time.sleep(20)
pywinauto.mouse.click(button="left",coords=(1275,270))
time.sleep(20)
app.ProSeriesLauncher.MenuSelect("File->Open Client").click()
**Error occurs:**
pywinauto.findbestmatch.MatchError: Could not find 'ProSeriesLauncher' in 'dict_keys([])'
This application has a menu "file" where there is Open Client I need to open by click. Is there any method Application name: ProSeries Basic.

How do I upload Icons from material-ui?

I have run npm install using material-ui icons
npm install #material-ui/icons
and imported the search icon in my code but I have not getting any output.
import SearchIcon from "#material-ui/icons/Search";
when I call the search icon
<SearchIcon />
the program outputs a blank screen but without it the code works fine. Does anyone know why the icon is not showing?
This is my code if it helps
The icons are not exported as default on the Material UI library. Therefore you also shouldn't try to import them as default. Try something like this:
import { Search as SearchIcon } from "#mui/icons-material";

Unable to hide code from a Playground Page

I tried hiding code from my Playground page by following Apple's doc: https://developer.apple.com/documentation/swift_playgrounds/hiding_code_from_a_playground_page
However, the following doesn't seem to work when rendering the documentation/playground page. Am I missing something here?
//#-hidden-code
import Foundation
import PlaygroundSupport
//#-end-hidden-code
Tested on:
Xcode 12.0
Xcode 11.5

Not able to import main app module in xctest

When using XCTest I am not able to import the main module. Instead of like importing #testable import App it is import #testable import Pods_App, also not able to import the main app structs and data. How to resolve this issue?
Click on your test file, then press CMD + OPTION + 0. This will bring up the inspector panel on the right side of the screen. Look for the target membership section inside the panel and ensure that the your test module is checked.

ui4j - Possible to screenshot the whole page?

I would like to capture a screenshot of a website including content that you can only see if you scrolled down.
Is that possible?
EDIT:
I already tried https://github.com/ui4j/ui4j/blob/master/ui4j-sample/src/main/java/com/ui4j/sample/ScreenCapture.java, but it did not capture the whole page, just the visible portion(inside my monitor's viewport).
page.show(true);
page.captureScreen(new FileOutputStream(file));
Yes, you could capture screenshot of the whole page with ui4j. Sample code:
package com.ui4j.sample;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import com.ui4j.api.browser.BrowserFactory;
import com.ui4j.api.browser.Page;
public class ScreenCapture {
public static void main(String[] args) throws FileNotFoundException {
Page page = BrowserFactory.getWebKit().navigate("https://www.google.com");
page.show(true);
page.captureScreen(new FileOutputStream(new File("google.png")));
}
}
Alternative solution:
I highly recommend to use cdp4j library for full page screen capture. Its a Java library which help to automate Chrome/Chromium based browser. Here is the sample code.