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

URL ਅਤੇ HTML ਨੂੰ DOCX ਵਿੱਚ ਬਦਲੋ

PHP API

HTML ਜਾਂ ਵੈਬ ਪੇਜਾਂ ਨੂੰ ਬਦਲਣ ਦੀ ਯੋਗਤਾ ਸ਼ਾਮਲ ਕਰਨਾ into ਤੁਹਾਡੇ ਐਪ ਲਈ ਸ਼ਬਦ ਦਸਤਾਵੇਜ਼ ਕਦੇ ਵੀ ਅਸਾਨ ਨਹੀਂ ਹੋਏ GrabzIt ਦਾ PHP API. ਪਰ ਤੁਹਾਨੂੰ ਸ਼ੁਰੂ ਕਰਨ ਤੋਂ ਪਹਿਲਾਂ ਯਾਦ ਰੱਖੋ ਕਿ ਫੋਨ ਕਰਨ ਤੋਂ ਬਾਅਦ URL ਟੂਡੋਕੈਕਸ, HTMLToDOCX or FileToDOCX .ੰਗ. The Save or SaveTo ਅਸਲ ਵਿੱਚ DOCX ਬਣਾਉਣ ਲਈ methodੰਗ ਨੂੰ ਬੁਲਾਇਆ ਜਾਣਾ ਚਾਹੀਦਾ ਹੈ.

ਮੁ Optionsਲੇ ਚੋਣਾਂ

ਵੈਬ ਪੇਜਾਂ ਨੂੰ ਡੀਓਸੀਐਕਸ ਦੇ ਤੌਰ ਤੇ ਕੈਪਚਰ ਕਰਨਾ ਪੂਰੇ ਵੈਬ ਪੇਜ ਨੂੰ ਬਦਲਦਾ ਹੈ intoa ਵਰਡ ਡੌਕੂਮੈਂਟ ਜਿਸ ਵਿੱਚ ਬਹੁਤ ਸਾਰੇ ਪੰਨੇ ਹੋ ਸਕਦੇ ਹਨ. ਹੇਠਾਂ ਦਿੱਤੀਆਂ ਉਦਾਹਰਣਾਂ ਵਿੱਚ ਪੀਐਚਪੀ HTML ਨੂੰ DOCX ਵਿੱਚ ਬਦਲਦਾ ਹੈ ਅਤੇ ਇੱਕ ਵੈੱਬ ਪੇਜ intਓ ਵਰਡ ਡੌਕੂਮੈਂਟ, ਸਿਰਫ ਇੱਕ ਲੋੜੀਂਦੇ ਪੈਰਾਮੀਟਰ ਦੇ ਨਾਲ.

$grabzIt->URLToDOCX("https://www.tesla.com");
//Then call the Save or SaveTo method
$grabzIt->HTMLToDOCX("<html><body><h1>Hello World!</h1></body></html>");
//Then call the Save or SaveTo method
$grabzIt->FileToDOCX("example.html");
//Then call the Save or SaveTo method

ਕਸਟਮ ਪਛਾਣਕਰਤਾ

ਤੁਸੀਂ ਇੱਕ ਕਸਟਮ ਪਛਾਣਕਰਤਾ ਨੂੰ ਪਾਸ ਕਰ ਸਕਦੇ ਹੋ ਡੌਕਸ shownੰਗ ਜਿਵੇਂ ਹੇਠਾਂ ਦਰਸਾਏ ਗਏ ਹਨ, ਇਹ ਮੁੱਲ ਤਦ ਤੁਹਾਡੇ ਗਰੈਬਜ਼ ਪੀਐਚਪੀ ਹੈਂਡਲਰ ਨੂੰ ਵਾਪਸ ਕਰ ਦਿੱਤਾ ਜਾਵੇਗਾ. ਉਦਾਹਰਣ ਦੇ ਲਈ ਇਹ ਕਸਟਮ ਪਛਾਣਕਰਤਾ ਇੱਕ ਡੇਟਾਬੇਸ ਪਛਾਣਕਰਤਾ ਹੋ ਸਕਦਾ ਹੈ, ਜਿਸ ਨਾਲ ਇੱਕ DOCX ਦਸਤਾਵੇਜ਼ ਨੂੰ ਇੱਕ ਵਿਸ਼ੇਸ਼ ਡਾਟਾਬੇਸ ਰਿਕਾਰਡ ਨਾਲ ਜੋੜਿਆ ਜਾ ਸਕਦਾ ਹੈ.

$grabzIt = new \GrabzIt\GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret");

$options = new \GrabzIt\GrabzItDOCXOptions();
$options->setCustomId(123456);

$grabzIt->URLToDOCX("https://www.tesla.com", $options);
//Then call the Save method
$grabzIt->Save("http://www.example.com/handler.php");
$grabzIt = new \GrabzIt\GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret");

$options = new \GrabzIt\GrabzItDOCXOptions();
$options->setCustomId(123456);

$grabzIt->HTMLToDOCX("<html><body><h1>Hello World!</h1></body></html>", $options);
//Then call the Save method
$grabzIt->Save("http://www.example.com/handler.php");
$grabzIt = new \GrabzIt\GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret");

$options = new \GrabzIt\GrabzItDOCXOptions();
$options->setCustomId(123456);

$grabzIt->FileToDOCX("example.html", $options);
//Then call the Save method
$grabzIt->Save("http://www.example.com/handler.php");

ਸਿਰਲੇਖ ਅਤੇ ਫੁੱਟਰ

ਜਦੋਂ ਕਿ ਗਰੈਬਜ਼ਿਟ ਰਵਾਇਤੀ ਵਰਡ ਟੈਂਪਲੇਟ ਦਾ ਸਮਰਥਨ ਨਹੀਂ ਕਰਦਾ. ਜਦੋਂ ਕਿਸੇ ਸ਼ਬਦ ਦਸਤਾਵੇਜ਼ ਵਿਚ ਸਿਰਲੇਖ ਜਾਂ ਫੁੱਟਰ ਸ਼ਾਮਲ ਕਰਦੇ ਹੋ ਤਾਂ ਤੁਸੀਂ ਬੇਨਤੀ ਕਰ ਸਕਦੇ ਹੋ ਕਿ ਤੁਸੀਂ ਏ ਟੈਪਲੇਟ ਨੂੰ ਤਿਆਰ ਕੀਤਾ ਜਾ ਰਿਹਾ DOCX ਕਰਨ ਲਈ. ਇਹ ਨਮੂਨਾ ਹੋਣਾ ਚਾਹੀਦਾ ਹੈ saveਡੀ ਪਹਿਲਾਂ ਤੋਂ ਹੈ ਅਤੇ ਸਿਰਲੇਖ ਅਤੇ ਫੁੱਟਰ ਦੀ ਸਮੱਗਰੀ ਨੂੰ ਕਿਸੇ ਵਿਸ਼ੇਸ਼ ਵੇਰੀਏਬਲ ਦੇ ਨਾਲ ਦਰਸਾਏਗਾ. ਹੇਠਾਂ ਦਿੱਤੇ ਕੋਡ ਵਿੱਚ ਉਪਭੋਗਤਾ ਇੱਕ ਟੈਂਪਲੇਟ ਦੀ ਵਰਤੋਂ ਕਰ ਰਿਹਾ ਹੈ ਜਿਸ ਨੂੰ ਉਹਨਾਂ ਨੇ ਬਣਾਇਆ ਹੈ ਜਿਸ ਨੂੰ "ਮੇਰਾ ਟੈਂਪਲੇਟ" ਕਹਿੰਦੇ ਹਨ.

$grabzIt = new \GrabzIt\GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret");

$options = new \GrabzIt\GrabzItDOCXOptions();
$options->setTemplateId("my template");

$grabzIt->URLToDOCX("https://www.tesla.com", $options);
//Then call the Save or SaveTo method
$grabzIt->SaveTo("result.docx");
$grabzIt = new \GrabzIt\GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret");

$options = new \GrabzIt\GrabzItDOCXOptions();
$options->setTemplateId("my template");

$grabzIt->HTMLToDOCX("<html><body><h1>Hello World!</h1></body></html>", $options);
//Then call the Save or SaveTo method
$grabzIt->SaveTo("result.docx");
$grabzIt = new \GrabzIt\GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret");

$options = new \GrabzIt\GrabzItDOCXOptions();
$options->setTemplateId("my template");

$grabzIt->FileToDOCX("example.html", $options);
//Then call the Save or SaveTo method
$grabzIt->SaveTo("result.docx");

HTML ਐਲੀਮੈਂਟ ਨੂੰ DOCX ਵਿੱਚ ਬਦਲੋ

ਜੇ ਤੁਸੀਂ ਸਿਰਫ ਇੱਕ HTML ਐਲੀਮੈਂਟ ਜਿਵੇਂ ਕਿ ਇੱਕ ਡਿਵ ਜਾਂ ਸਪੈਨ ਸਿੱਧੇ ਰੂਪ ਵਿੱਚ ਬਦਲਣਾ ਚਾਹੁੰਦੇ ਹੋ intਓ ਵਰਡ ਡੌਕੂਮੈਂਟ ਜੋ ਤੁਸੀਂ ਗਰੈਬਜ਼ਿਟ ਦੀ ਪੀਐਚਪੀ ਲਾਇਬ੍ਰੇਰੀ ਨਾਲ ਕਰ ਸਕਦੇ ਹੋ. ਤੁਹਾਨੂੰ ਪਾਸ ਕਰਨਾ ਚਾਹੀਦਾ ਹੈ CSS ਚੋਣਕਾਰ ਐਲੀਮੈਂਟਲ ਐਲਿਮੰਟ ਦਾ ਜਿਸ ਨੂੰ ਤੁਸੀਂ ਤਬਦੀਲ ਕਰਨਾ ਚਾਹੁੰਦੇ ਹੋ setTargetElement GrabzIt ਦੀ ਵਿਧੀDOCXOptions ਕਲਾਸ.

...
<span id="Article">
<p>This is the content I am interested in.</p>
<img src="myimage.jpg">
</span>
...

ਇਸ ਉਦਾਹਰਣ ਵਿੱਚ, ਅਸੀਂ ਸਾਰੀ ਸਮਗਰੀ ਨੂੰ ਉਸ ਅਵਧੀ ਵਿੱਚ ਕੈਪਚਰ ਕਰਨਾ ਚਾਹੁੰਦੇ ਹਾਂ ਜਿਸ ਦੀ ਆਈ ਡੀ ਹੈ Article. ਇਸ ਨੂੰ GrabzIt ਨੂੰ ਪਾਸ ਕਰਦਿਆਂ, ਹੇਠਾਂ ਦਰਸਾਇਆ ਗਿਆ.

$grabzIt = new \GrabzIt\GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret");

$options = new \GrabzIt\GrabzItDOCXOptions();
$options->setTargetElement("#Article");

$grabzIt->URLToDOCX("http://www.bbc.co.uk/news", $options);
//Then call the Save or SaveTo method
$grabzIt->SaveTo("result.docx");

ਇਹ ਮਾਇਨੇ ਨਹੀਂ ਰੱਖਦਾ ਕਿ ਜੇ ਤੁਸੀਂ ਇੱਕ URL ਨੂੰ ਵਰਡ ਵਿੱਚ ਬਦਲ ਰਹੇ ਹੋ ਜਿਵੇਂ ਕਿ ਉਦਾਹਰਣ ਵਿੱਚ ਦਿਖਾਇਆ ਗਿਆ ਹੈ ਜਾਂ HTML ਨੂੰ ਸ਼ਬਦ ਵਿੱਚ. ਦੋਵੇਂ ਬਿਲਕੁਲ ਉਸੇ ਤਰੀਕੇ ਨਾਲ HTML ਤੱਤ ਨੂੰ ਨਿਸ਼ਾਨਾ ਬਣਾਉਂਦੇ ਹਨ.