ਵੈੱਬ ਨੂੰ ਕੈਪਚਰ ਅਤੇ ਕਨਵਰਟ ਕਰਨ ਲਈ ਟੂਲ

ਜਾਵਾ ਸਕ੍ਰਿਪਟ ਸਕ੍ਰੀਨ ਸ਼ਾਟ API ਦੇ ਨਾਲ ਇੱਕ ਡਿਵ ਕੈਪਚਰ ਕਰੋ

ਜਾਵਾਸਕ੍ਰਿਪਟ API

ਇੱਕ ਆਮ ਜ਼ਰੂਰਤ ਇਹ ਹੈ ਕਿ ਕਿਵੇਂ ਇੱਕ HTML ਪੰਨੇ ਵਿੱਚ ਇੱਕ ਸਿੰਗਲ HTML ਤੱਤ ਦੇ ਭਾਗਾਂ ਨੂੰ ਕੈਪਚਰ ਕਰਨਾ ਹੈ. ਜਿਵੇਂ ਕਿ ਇੱਕ ਡਿਵ, ਸਪੈਨ ਜਾਂ ਕੈਨਵਸ ਤੱਤ.

However, before you can capture a single HTML element using client side code. Such as an image, PDF or DOCX screenshot. To use the JavaScript Screenshot API. You will need to ਸਾਈਨ ਅੱਪ ਕਰੋ ਮੁਫ਼ਤ ਅਤੇ ਫਿਰ ਸਾਡੇ ਨੂੰ ਡਾ .ਨਲੋਡ ਕਰੋ ਮੁਫਤ ਜਾਵਾ ਸਕ੍ਰਿਪਟ ਲਾਇਬ੍ਰੇਰੀ.

Once you do this, capturing an HTML element is easy. You just need to pass the CSS ਚੋਣਕਾਰ ਐਲੀਮੈਂਟ ਦੇ ਜਿਸ ਉੱਤੇ ਤੁਸੀਂ ਕੈਪਚਰ ਕਰਨਾ ਚਾਹੁੰਦੇ ਹੋ ਟੀਚਾ ਪੈਰਾਮੀਟਰ.

To construct your CSS selector you will need to find the HTML element that you want to capture. To do this look at the HTML source of the webpage you are trying to capture the element from. An example of this is below.

<div id="features">
	<h4>Acme Camera</h4>
	<label>Price</label>$399<br />
	<label>Rating</label>4.5 out of 5
</div>
<p>Cras ut velit sed purus porttitor aliquam. Nulla tristique magna ac libero tempor, ac vestibulum felisvulput ate. Nam ut velit
risus porttitor tristique at ac diam. Sed nisi risus, rutrum a metus suscipit, euismod tristique nulla. Etiam venenatis rutrum
blandit. In hac habitasse platea dictumst. Suspendisse potenti. Phasellus eget vehicula felis.</p>

ਇਸ ਲਈ ਉਦਾਹਰਣ ਲਈ ਸਿਰਫ ਉੱਪਰ ਦਿੱਤੇ ਡਿਵ ਦੀ ਸਕ੍ਰੀਨਸ਼ਾਟ ਲਈ features use the JavaScript code below.

This JavaScript additionally autosizes the resultant image screenshot to the same dimensions as the targeted HTML element. By setting the bheight, height ਅਤੇ width ਪੈਰਾਮੀਟਰ to -1. When the page loads, it will create an image screenshot in the same location as the script tag. This will contain the contents of the features ਭਾਗ ਅਤੇ ਹੋਰ ਕੁਝ ਨਹੀਂ.

<script src="https://cdn.jsdelivr.net/npm/@grabzit/js@/grabzit.min.js"></script>
<script type="text/javascript">
GrabzIt("Sign in to view your Application Key").ConvertURL("http://www.example.com/my-page.html",
{"target": "#features", "bheight": -1, "height": -1, "width": -1}).Create();
</script>
<script src="https://cdn.jsdelivr.net/npm/@grabzit/js@/grabzit.min.js"></script>
<script type="text/javascript">
GrabzIt("Sign in to view your Application Key").ConvertURL("http://www.example.com/my-page.html",
{"target": "#features", "format": "pdf"}).Create();
</script>
<script src="https://cdn.jsdelivr.net/npm/@grabzit/js@/grabzit.min.js"></script>
<script type="text/javascript">
GrabzIt("Sign in to view your Application Key").ConvertURL("http://www.example.com/my-page.html",
{"target": "#features", "format": "docx"}).Create();
</script>

ਬੇਸ਼ਕ, ਤੁਸੀਂ HTML ਐਲੀਮੈਂਟਸ ਨੂੰ ਵੀ ਕੈਪਚਰ ਕਰ ਸਕਦੇ ਹੋ ਜਦੋਂ HTML ਨੂੰ ਇੱਕ ਚਿੱਤਰ, PDF ਜਾਂ DOCX ਵਿੱਚ ਤਬਦੀਲ ਕਰਦੇ ਹੋ. ਬਸ ਵਿਧੀ ਨੂੰ ਤਬਦੀਲ ਕਰੋ ConvertURL ਨਾਲ ConvertHTML ਉਪਰੋਕਤ

ਗਤੀਸ਼ੀਲ ਸਮੱਗਰੀ ਨੂੰ ਕੈਪਚਰ ਕਰਨਾ

ਅਕਸਰ ਤੁਸੀਂ ਪੇਜ ਦੀ ਸਮਗਰੀ ਨੂੰ ਉਪਭੋਗਤਾ ਦੇ ਬਾਅਦ ਪ੍ਰਾਪਤ ਕਰਨਾ ਚਾਹੁੰਦੇ ਹੋ intਇਸ ਨੂੰ ਕਿਸੇ ਤਰੀਕੇ ਨਾਲ ਕੱractedਿਆ, ਉਦਾਹਰਣ ਲਈ ਇੱਕ ਫਾਰਮ ਭਰਨ ਤੋਂ ਬਾਅਦ. GrabzIt ਤੁਹਾਨੂੰ ਇਹ ਪ੍ਰਦਾਨ ਕਰਕੇ ਅਜਿਹਾ ਕਰਨ ਦੇ ਯੋਗ ਕਰਦਾ ਹੈ ConvertPage method. This sends the current HTML of the web page along with the URL of the web page to GrabzIt. The system then loads the content in a browser and converts it into an image, DOCX, or PDF document.

To load resources such as CSS or images referenced by absolute URL. You need an internet connection for this method to work properly.

<div id="divSection">
    <form id="myForm">
        <label>Name</label><input type="text" name="name" />
        <label>Age</label><input type="text" name="age" />
        <input type="button" data-gt-translate-attributes='[{"attribute":"value","format":"json"}]' value="Save"/>
    </form>
</div>

The example makes a copy of a webpage, updates it with form values, and sends it to GrabzIt for conversion. As we only want to capture the div divSection, ਜਿਵੇਂ ਉੱਪਰ ਦਰਸਾਇਆ ਗਿਆ ਹੈ ਅਸੀਂ ਉਸ ਨੂੰ ਇੱਕ ਟੀਚੇ ਦੇ ਰੂਪ ਵਿੱਚ ਪਾਸ ਕਰ ਰਹੇ ਹਾਂ. ਹਾਲਾਂਕਿ ਤੁਸੀਂ JSON ਪੈਰਾਮੀਟਰਾਂ ਨੂੰ ਨਿਰਧਾਰਿਤ ਨਹੀਂ ਕਰ ਸਕਦੇ ਹੋ ਅਤੇ ਪੂਰੇ ਵੈੱਬਪੇਜ ਨੂੰ ਕੈਪਚਰ ਨਹੀਂ ਕਰ ਸਕਦੇ ਹੋ ਕਿਉਂਕਿ ਇਹ ਉਪਭੋਗਤਾ ਦੁਆਰਾ ਅਪਡੇਟ ਕੀਤਾ ਗਿਆ ਹੈ.

<script src="https://cdn.jsdelivr.net/npm/@grabzit/js@/grabzit.min.js"></script>
<script>
GrabzIt("Sign in to view your Application Key").ConvertPage({"target": "#divSection", "bheight": -1, "height": -1, "width": -1}).Create();
</script>

ਇੱਕ ਐਚਡੀਐਮਐਲ ਐਲੀਮੈਂਟ ਨੂੰ ਨਿਸ਼ਾਨਾ ਬਣਾਉਂਦੇ ਸਮੇਂ ਇੱਕ ਪੀਡੀਐਫ ਕਿਵੇਂ ਤਿਆਰ ਕੀਤੀ ਜਾਂਦੀ ਹੈ ਇਨ੍ਹਾਂ ਤਕਨੀਕਾਂ ਦੀ ਵਰਤੋਂ ਨਾਲ ਨਿਯੰਤਰਿਤ.

<script src="https://cdn.jsdelivr.net/npm/@grabzit/js@/grabzit.min.js"></script>
<script>
GrabzIt("Sign in to view your Application Key").ConvertPage({"target": "#divSection", "format": "pdf"}).Create();
</script>
<script src="https://cdn.jsdelivr.net/npm/@grabzit/js@/grabzit.min.js"></script>
<script>
GrabzIt("Sign in to view your Application Key").ConvertPage({"target": "#divSection", "format": "docx"}).Create();
</script>

ਵੈਬਸਾਈਟ ਦੀ ਪ੍ਰਕਿਰਤੀ ਦੇ ਅਧਾਰ ਤੇ ਜੋ ਤੁਸੀਂ ਕੈਪਚਰ ਕਰ ਰਹੇ ਹੋ ਤੁਸੀਂ ਸਮੱਗਰੀ ਨੂੰ ਕੈਪਚਰ ਕਰਨ ਲਈ ਵੀ ਇਸ ਪਹੁੰਚ ਦੀ ਵਰਤੋਂ ਕਰ ਸਕਦੇ ਹੋ ਇੱਕ ਲਾਗਇਨ ਦੇ ਪਿੱਛੇ. Simply use the above approach, with or without the target parameters as desired. Then if you have not restricted the page resources, you can capture the webpage content as seen by the user.