વેબપેજ અને HTML ને પીડીએફમાં રૂપાંતરિત કરતી વખતે GrabzIt નું ASP.NET API નીચેની સુવિધાઓ પ્રદાન કરે છે જે મદદ કરે છે intદા.ત. GrabzIt intતમારી સિસ્ટમ શક્ય તેટલી સરળતાથી. જો કે તમે પ્રારંભ કરતા પહેલા યાદ રાખો કે ફોન કર્યા પછી URLToPDF, HTMLToPDF or FileToPDF પદ્ધતિઓ Save or SaveTo પીડીએફ સ્ક્રીનશોટ લેવા માટે પદ્ધતિને ક beલ કરવી આવશ્યક છે.
એક પીડીએફ સ્ક્રીનશોટ આખા વેબપૃષ્ઠને કબજે કરશે અને એક પીડીએફ દસ્તાવેજ બનાવશે જે મૂળ વેબપેજ જેટલી લંબાઈનું છે. વેબ પૃષ્ઠને કન્વર્ટ કરવા માટે ફક્ત એક જ પરિમાણ આવશ્યક છે intઅથવા પીડીએફ દસ્તાવેજ અથવા 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
તમે કસ્ટમ ઓળખાણકર્તાને પાસ કરી શકો છો પીડીએફ નીચે બતાવેલ પદ્ધતિઓ, આ મૂલ્ય પછી તમારા 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");
જ્યારે તમે પીડીએફ સ્ક્રીનશોટ બનાવો છો ત્યારે તમે જણાવી શકો છો કે તમે કોઈ વિશેષને લાગુ કરવા માંગો છો નમૂનો જનરેટ પીડીએફ પર. આ ટેમ્પલેટ અગાઉથી બનાવવું આવશ્યક છે અને હેડર અને ફૂટરની સામગ્રીને કોઈપણ વિશિષ્ટ ચલો સાથે વ્યાખ્યાયિત કરશે. નીચે આપેલા ઉદાહરણ કોડમાં વપરાશકર્તા પીડીએફ ટેમ્પલેટ "મારો ટેમ્પલેટ" લાગુ કરી રહ્યો છે.
જો અનુક્રમે હેડર અથવા ફૂટર માટે મોટો અથવા નીચેનો ગાળો ન હોય, તો તે પીડીએફમાં દેખાશે નહીં. પુષ્કળ જગ્યા પ્રદાન કરવા માટે નીચેના ઉદાહરણમાં, અમે 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");
જો તમે ફક્ત એચટીએમએલ તત્વ જેમ કે ડીવી અથવા સ્પ spન સીધા રૂપાંતરિત કરવા માંગો છો intOa PDF દસ્તાવેજ તમે GrabzIt ની ASP.NET લાઇબ્રેરીથી કરી શકો છો. તમારે પાસ કરવું આવશ્યક છે સીએસએસ પસંદગીકાર તમે HTML માં કન્વર્ટ કરવા માંગો છો તે 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 તત્વને લક્ષ્ય બનાવવું હોય ત્યારે પીડીએફ કેવી રીતે કાપવામાં આવે છે આ તકનીકોનો ઉપયોગ કરીને નિયંત્રિત.