DOCX ਜਾਂ PDF ਦਸਤਾਵੇਜ਼ਾਂ ਵਿੱਚ ਸਿਰਲੇਖ ਅਤੇ/ਜਾਂ ਫੁੱਟਰ ਜੋੜਨ ਲਈ ਤੁਹਾਨੂੰ ਪਹਿਲਾਂ ਲੋੜ ਹੈ ਇੱਕ ਟੈਪਲੇਟ ਬਣਾਓ, ਇੱਕ ਨਿਸ਼ਚਿਤ ਪਛਾਣਕਰਤਾ ਦੇ ਨਾਲ। ਇਸ ਮਾਮਲੇ ਵਿੱਚ report
. ਟੈਮਪਲੇਟ ਵਿੱਚ ਉਹ ਸਾਰੇ ਟੈਕਸਟ, ਚਿੱਤਰ ਅਤੇ ਟੇਬਲ ਸ਼ਾਮਲ ਹੋ ਸਕਦੇ ਹਨ ਜੋ ਤੁਸੀਂ ਪ੍ਰਦਰਸ਼ਿਤ ਕਰਨਾ ਚਾਹੁੰਦੇ ਹੋ, ਸਿਰਲੇਖ ਅਤੇ ਫੁੱਟਰ ਕਦੋਂ ਦਿਖਾਉਣੇ ਹਨ ਦੇ ਨਿਯਮਾਂ ਦੇ ਨਾਲ।
ਇਸ ਤੋਂ ਇਲਾਵਾ ਟੈਂਪਲੇਟਾਂ ਵਿੱਚ ਵੇਰੀਏਬਲ ਵਿੱਚ ਬਿਲਟ-ਇਨ ਸ਼ਾਮਲ ਹੋ ਸਕਦੇ ਹਨ, ਜਿਵੇਂ ਕਿ ਪੰਨਾ ਨੰਬਰ। ਜਾਂ ਕਸਟਮ ਟੈਂਪਲੇਟ ਵੇਰੀਏਬਲ ਜਿਸ ਵਿੱਚ ਕੋਈ ਵੀ ਸਾਦਾ ਟੈਕਸਟ ਹੋ ਸਕਦਾ ਹੈ। ਕਸਟਮ ਟੈਂਪਲੇਟ ਵੇਰੀਏਬਲ ਦੀ ਵਰਤੋਂ ਕਰਕੇ HTML ਨੂੰ ਪਾਸ ਕਰਨਾ ਸੰਭਵ ਨਹੀਂ ਹੈ, ਹਾਲਾਂਕਿ ਕੋਈ ਵੀ /n ਜਾਂ /r ਅੱਖਰ ਲਾਈਨ ਬਰੇਕਾਂ ਵਿੱਚ ਬਦਲ ਦਿੱਤੇ ਜਾਣਗੇ।
ਹੇਠਾਂ ਦਿੱਤੀ ਉਦਾਹਰਨ ਵਿੱਚ, ਸਿਰਲੇਖ ਲਈ ਟੈਕਸਟ ਵਿੱਚ ਇੱਕ ਕਸਟਮ ਵੇਰੀਏਬਲ ਵਰਤਿਆ ਜਾ ਰਿਹਾ ਹੈ, ਸਨ {number}
ਇੱਕ ਕਸਟਮ ਵੇਰੀਏਬਲ ਹੈ।
Report number: {number}
ਤੁਸੀਂ ਫਿਰ ਕਿਸੇ ਵੀ DOCX ਜਾਂ PDF ਦਸਤਾਵੇਜ਼ ਵਿੱਚ ਦਿੱਤੇ ਸਿਰਲੇਖ ਨੂੰ ਜੋੜਨ ਲਈ ਇਸ ਟੈਂਪਲੇਟ ਪਛਾਣਕਰਤਾ ਨੂੰ GrabzIt ਵਿੱਚ ਪਾਸ ਕਰ ਸਕਦੇ ਹੋ। ਹੇਠਾਂ ਦਿੱਤੀਆਂ ਉਦਾਹਰਣਾਂ ਵਿੱਚ ਉਪਰੋਕਤ ਸਿਰਲੇਖ ਹਰੇਕ ਤਿਆਰ ਕੀਤੇ PDF ਦਸਤਾਵੇਜ਼ ਵਿੱਚ ਪ੍ਰਦਰਸ਼ਿਤ ਕੀਤਾ ਗਿਆ ਹੈ, ਹਰੇਕ ਪ੍ਰੋਗਰਾਮਿੰਗ ਭਾਸ਼ਾ ਲਈ ਜੋ ਅਸੀਂ ਸਮਰਥਨ ਕਰਦੇ ਹਾਂ। ਹਾਲਾਂਕਿ ਇਸ ਕੋਡ ਨੂੰ ਆਸਾਨੀ ਨਾਲ DOCX ਦਸਤਾਵੇਜ਼ਾਂ ਵਿੱਚ ਸਿਰਲੇਖ ਅਤੇ ਫੁੱਟਰ ਜੋੜਨ ਲਈ ਅਨੁਕੂਲਿਤ ਕੀਤਾ ਜਾ ਸਕਦਾ ਹੈ।
GrabzItClient grabzIt = new GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret"); PDFOptions options = new PDFOptions(); options.TemplateId = "report"; options.MarginTop = 50; options.MarginBottom = 50; options.AddTemplateParameter("number", "12345"); grabzIt.URLToPDF("http://www.spacex.com", options); grabzIt.Save("http://www.example.com/Home/Index");
GrabzItClient grabzIt = new GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret"); PDFOptions options = new PDFOptions(); options.setTemplateId("report"); options.setMarginTop(50); options.setMarginBottom(50); options.AddTemplateParameter("number", "12345"); grabzIt.URLToPDF("http://www.spacex.com", options); grabzIt.Save("http://www.example.com/handler");
<script src="https://cdn.jsdelivr.net/npm/@grabzit/js@3.5.2/grabzit.min.js"></script>
<script>
GrabzIt("Sign in to view your Application Key").AddTemplateVariable("number", "12345").ConvertURL("http://www.spacex.com",
{"format": "pdf",
"mtop":50,
"mbottom":50,
"templateid":"report"}).Create();
</script>
ਮਲਟੀਪਲ ਟੈਂਪਲੇਟ ਵੇਰੀਏਬਲ ਨਿਸ਼ਚਿਤ ਕਰਨ ਲਈ ਹਰ ਕੁੰਜੀ ਮੁੱਲ ਜੋੜੇ ਨੂੰ a ਨਾਲ ਵੱਖ ਕਰੋ &
.
var grabzit = require('grabzit'); var client = new grabzit("Sign in to view your Application Key", "Sign in to view your Application Secret"); var options = {"marginTop":50,"marginBottom":50,"templateId":"report", "templateVariables":"number=12345"}; client.url_to_pdf("http://www.spacex.com", options); client.save("http://www.example.com/handler", function (error, id){ if (error != null){ throw error; } });
$grabzIt = GrabzItClient->new("Sign in to view your Application Key", "Sign in to view your Application Secret"); $options = GrabzItPDFOptions->new(); $options->marginTop(50); $options->marginBottom(50); $options->templateId("report"); $options->AddTemplateParameter("number","12345"); $grabzIt->URLToPDF("http://www.spacex.com", $options); $grabzIt->Save("http://www.example.com/handler.pl");
$grabzIt = new \GrabzIt\GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret"); $options = new \GrabzIt\GrabzItPDFOptions(); $options->setMarginTop(50); $options->setMarginBottom(50); $options->setTemplateId("report"); $options->AddTemplateParameter("number","12345"); $grabzIt->URLToPDF("http://www.spacex.com", $options); $grabzIt->Save("http://www.example.com/handler.php");
grabzIt = GrabzItClient.GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret") options = GrabzItPDFOptions.GrabzItPDFOptions() options.marginTop = 50 options.marginBottom = 50 options.templateId = "report" options.AddTemplateParameter("number","12345") grabzIt.URLToPDF("http://www.spacex.com", options) grabzIt.Save("http://www.example.com/handler.py")
ਬੇਨਤੀਆਂ ਕਰਨ ਵੇਲੇ ਯਾਦ ਰੱਖੋ ਕਿਰਪਾ ਕਰਕੇ ਯਕੀਨੀ ਬਣਾਓ ਸਾਰੇ ਪੈਰਾਮੀਟਰ ਮੁੱਲ URL ਏਨਕੋਡ ਕੀਤੇ ਗਏ ਹਨ। ਨੋਟ ਕਰੋ ਕਿ ਹਰੇਕ POST ਨਾਮ ਅਤੇ ਮੁੱਲ ਨੂੰ ਵੀ ਪਹਿਲਾਂ URL ਏਨਕੋਡ ਕੀਤਾ ਜਾਣਾ ਚਾਹੀਦਾ ਹੈ। ਮਲਟੀਪਲ ਟੈਂਪਲੇਟ ਵੇਰੀਏਬਲ ਨਿਸ਼ਚਿਤ ਕਰਨ ਲਈ ਹਰ ਕੁੰਜੀ ਮੁੱਲ ਜੋੜੇ ਨੂੰ a ਨਾਲ ਵੱਖ ਕਰੋ &
, ਫਿਰ URL ਨੂੰ ਏਨਕੋਡ ਕਰੋ tvars
ਪੈਰਾਮੀਟਰ.
https://api.grabz.it/services/convert?key=Sign in to view your Application Key&format=pdf&tvars=number%3D12345&mtop=50&mbottom=50&templateid=report&url=https%3A%2F%2Fspacex.com%2F
grabzIt = GrabzIt::Client.new("Sign in to view your Application Key", "Sign in to view your Application Secret") options = GrabzIt::PDFOptions.new() options.marginTop = 50 options.marginBottom = 50 options.templateId = "report" options.add_template_parameter("number","12345") grabzIt.url_to_pdf("http://www.spacex.com", options) grabzItClient.save("http://www.example.com/handler/index")
PDF ਦਸਤਾਵੇਜ਼ ਤਿਆਰ ਕਰਦੇ ਸਮੇਂ ਤੁਹਾਨੂੰ ਇਹ ਯਕੀਨੀ ਬਣਾਉਣਾ ਚਾਹੀਦਾ ਹੈ ਕਿ ਤੁਹਾਡੇ ਸਿਰਲੇਖ ਜਾਂ ਫੁੱਟਰ ਨੂੰ ਦਿਖਾਈ ਦੇਣ ਲਈ ਲੋੜੀਂਦੀ ਥਾਂ ਹੈ। ਅਜਿਹਾ ਕਰਨ ਲਈ ਸਿਰਲੇਖ ਦੇ ਦਿਖਾਈ ਦੇਣ ਲਈ ਕਾਫ਼ੀ ਵੱਡਾ ਸਿਖਰ ਮਾਰਜਿਨ ਅਤੇ ਫੁੱਟਰ ਦੇ ਦਿਖਾਈ ਦੇਣ ਲਈ ਕਾਫ਼ੀ ਵੱਡਾ ਹੇਠਲਾ ਮਾਰਜਿਨ ਨਿਰਧਾਰਤ ਕਰੋ। ਹਾਸ਼ੀਏ ਦਾ ਆਕਾਰ ਸਹੀ ਪ੍ਰਾਪਤ ਕਰਨ ਲਈ ਕੁਝ ਅਜ਼ਮਾਇਸ਼ ਅਤੇ ਗਲਤੀ ਦੀ ਲੋੜ ਹੋ ਸਕਦੀ ਹੈ।