ویب صفحات اور HTML کو پی ڈی ایف میں تبدیل کرتے وقت GrabzIt کا ASP.NET API مدد کرنے میں مندرجہ ذیل خصوصیات مہیا کرتی ہیں intمثال کے طور پر GrabzIt into آپ کا سسٹم جتنا آسانی سے ممکن ہو سکے۔ تاہم ، اس سے پہلے کہ آپ فون کریں ، یاد رکھیں URLToPDF, HTMLToPDF or FileToPDF طریقوں Save or SaveTo پی ڈی ایف اسکرین شاٹ لینے کے ل method طریقہ کو بلایا جانا چاہئے۔
ایک پی ڈی ایف اسکرین شاٹ پورے ویب پیج پر قبضہ کرے گا اور ایک ایسا پی ڈی ایف دستاویز بنائے گا جس کی لمبائی اصلی ویب پیج کی طرح ہے۔ ویب پیج کو تبدیل کرنے کیلئے صرف ایک پیرامیٹر کی ضرورت ہے intOA پی ڈی ایف دستاویز یا کرنے کے لئے HTML کو پی ڈی ایف میں تبدیل کریں جیسا کہ ذیل میں دکھایا گیا.
grabzIt.URLToPDF("https://www.tesla.com"); //Then call the Save or SaveTo method
grabzIt.HTMLToPDF("<html><body><h1>Hello World!</h1></body></html>"); //Then call the Save or SaveTo method
grabzIt.FileToPDF("example.html"); //Then call the Save or SaveTo method
آپ کو ایک کسٹم شناخت کنندہ پاس کرسکتے ہیں PDF جیسا کہ ذیل میں دکھایا گیا ہے ، اس کی قیمت آپ کے GrabzIt ASP.NET ہینڈلر کو واپس کردی جاتی ہے۔ مثال کے طور پر یہ کسٹم شناخت کنندہ ایک ڈیٹا بیس شناخت کنندہ ہوسکتا ہے ، جس سے اسکرین شاٹ کو کسی خاص ڈیٹا بیس ریکارڈ کے ساتھ وابستہ کیا جاسکتا ہے۔
GrabzItClient grabzIt = new GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret"); PDFOptions options = new PDFOptions(); options.CustomId = "123456"; grabzIt.URLToPDF("https://www.tesla.com", options); //Then call the Save method grabzIt.Save("http://www.example.com/Home/Handler");
GrabzItClient grabzIt = new GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret"); PDFOptions options = new PDFOptions(); options.CustomId = "123456"; grabzIt.HTMLToPDF("<html><body><h1>Hello World!</h1></body></html>", options); //Then call the Save method grabzIt.Save("http://www.example.com/Home/Handler");
GrabzItClient grabzIt = new GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret"); PDFOptions options = new PDFOptions(); options.CustomId = "123456"; grabzIt.FileToPDF("example.html", options); //Then call the Save method grabzIt.Save("http://www.example.com/Home/Handler");
جب آپ پی ڈی ایف اسکرین شاٹ بناتے ہیں تو آپ بیان کرسکتے ہیں کہ آپ کسی خاص کو لاگو کرنا چاہتے ہیں سانچے پیدا پی ڈی ایف میں. اس ٹیمپلیٹ کو پہلے ہی تشکیل دینا چاہئے اور ہیڈر اور فوٹر کے مندرجات کی وضاحت کسی خاص متغیر کے ساتھ کریں گے۔ مثال کے نیچے کوڈ میں صارف پی ڈی ایف ٹیمپلیٹ "میرا ٹیمپلیٹ" استعمال کر رہا ہے۔
اگر بالترتیب ہیڈر یا فوٹر کے ل enough کافی حد تک اوپر یا نیچے مارجن نہیں ہے تو ، یہ پی ڈی ایف میں ظاہر نہیں ہوگا۔ مندرجہ ذیل مثال میں ہم نے کافی مقدار میں جگہ فراہم کرنے کے لئے اوپر اور نیچے مارجن 20 پر طے کیا ہے۔
GrabzItClient grabzIt = new GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret"); PDFOptions options = new PDFOptions(); options.MarginTop = 20; options.MarginBottom = 20; options.TemplateId = "my template"; grabzIt.URLToPDF("https://www.tesla.com", options); //Then call the Save or SaveTo method grabzIt.SaveTo("result.pdf");
GrabzItClient grabzIt = new GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret"); PDFOptions options = new PDFOptions(); options.MarginTop = 20; options.MarginBottom = 20; options.TemplateId = "my template"; grabzIt.HTMLToPDF("<html><body><h1>Hello World!</h1></body></html>", options); //Then call the Save or SaveTo method grabzIt.SaveTo("result.pdf");
GrabzItClient grabzIt = new GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret"); PDFOptions options = new PDFOptions(); options.MarginTop = 20; options.MarginBottom = 20; options.TemplateId = "my template"; grabzIt.FileToPDF("example.html", options); //Then call the Save or SaveTo method grabzIt.SaveTo("result.pdf");
اگر آپ صرف کسی HTML عنصر کو تبدیل کرنا چاہتے ہیں جیسے کہ Div یا مدت براہ راست intOA PDF دستاویز جو آپ GrabzIt کی ASP.NET لائبریری کے ساتھ کرسکتے ہیں۔ آپ کو پاس کرنا ہوگا سی ایس ایس سلیکٹر HTML عنصر کی جس میں آپ تبدیل کرنا چاہتے ہیں TargetElement
پیرامیٹر
... <span id="Article"> <p>This is the content I am interested in.</p> <img src="myimage.jpg"> </span> ...
اس مثال میں ، ہم چاہتے ہیں کہ اس مدت میں وہ تمام مواد حاصل کریں جس کی شناخت ہو Article
، لہذا ہم اسے GrabzIt کے پاس جیسا کہ ذیل میں دکھایا گیا ہے۔
GrabzItClient grabzIt = new GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret"); PDFOptions options = new PDFOptions(); options.TargetElement = "#Article"; grabzIt.URLToPDF("http://www.bbc.co.uk/news", options); //Then call the Save or SaveTo method grabzIt.SaveTo("result.pdf");
جب کسی HTML عنصر کو نشانہ بنانا ہو تو پی ڈی ایف کس طرح کٹ جاتا ہے ان تکنیکوں کا استعمال کرتے ہوئے کنٹرول کیا.