વેબને કેપ્ચર અને કન્વર્ટ કરવા માટેનાં સાધનો

URL ને અને HTML ને DOCX માં કન્વર્ટ કરો

જાવા API

એચટીએમએલ અથવા વેબપેજને કન્વર્ટ કરવાની ક્ષમતા ઉમેરવી into તમારી એપ્લિકેશનના શબ્દ દસ્તાવેજો સાથે ક્યારેય સરળ નહોતા GrabzIt ની જાવા API. જો કે તમે પ્રારંભ કરતા પહેલા યાદ રાખો કે ફોન કર્યા પછી URLToDOCX, HTMLToDOCX or FileToDOCX પદ્ધતિઓ Save or SaveTo ખરેખર DOCX બનાવવા માટે પદ્ધતિને ક .લ કરવી આવશ્યક છે.

મૂળભૂત વિકલ્પો

વેબ પૃષ્ઠોને DOCX તરીકે કેપ્ચર કરવું એ આખા વેબ પૃષ્ઠને રૂપાંતરિત કરે છે intOa વર્ડ ડોક્યુમેન્ટ જેમાં ઘણા પૃષ્ઠો શામેલ હોઈ શકે છે. વેબ પૃષ્ઠને કન્વર્ટ કરવા માટે ફક્ત એક જ પરિમાણ આવશ્યક છે intઓએ વર્ડ ડોક્યુમેન્ટ અથવા ટુ HTML ને DOCX માં કન્વર્ટ કરો નીચેના ઉદાહરણોમાં બતાવ્યા પ્રમાણે.

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

કસ્ટમ ઓળખકર્તા

તમે કસ્ટમ ઓળખાણકર્તાને પાસ કરી શકો છો ડોક્સ નીચે બતાવેલ પદ્ધતિઓ, આ મૂલ્ય પછી તમારા GrabzIt જાવા હેન્ડલર પર પાછા ફર્યા છે. હમણાં પૂરતું આ કસ્ટમ ઓળખકર્તા ડેટાબેસ ઓળખકર્તા હોઈ શકે છે, જેમાં કોઈ DOCX દસ્તાવેજને ચોક્કસ ડેટાબેઝ રેકોર્ડ સાથે સંકળાયેલ હોઈ શકે છે.

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

DOCXOptions options = new DOCXOptions();
options.setCustomId("123456");

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

DOCXOptions options = new DOCXOptions();
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");
GrabzItClient grabzIt = new GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret");

DOCXOptions options = new DOCXOptions();
options.setCustomId("123456");

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

હેડરો અને ફૂટર્સ

વર્ડ ડોક્યુમેન્ટમાં હેડર અથવા ફૂટર ઉમેરવા માટે તમે વિનંતી કરી શકો છો કે તમે કોઈ ખાસ લાગુ કરવા માંગો છો નમૂનો DOCX જનરેટ થઈ રહી છે. આ ટેમ્પલેટ હોવો જોઈએ saveડી અગાઉથી અને કોઈપણ ખાસ ચલો સાથે હેડર અને ફૂટરની સામગ્રીનો ઉલ્લેખ કરશે. નીચે આપેલા ઉદાહરણ કોડમાં વપરાશકર્તા નમૂના બનાવે છે જેનો તેઓએ "મારુ ટેમ્પલેટ" કહે છે.

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

DOCXOptions options = new DOCXOptions();
options.setTemplateId("my template");

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

DOCXOptions options = new DOCXOptions();
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");
GrabzItClient grabzIt = new GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret");

DOCXOptions options = new DOCXOptions();
options.setTemplateId("my template");

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

HTML તત્વને DOCX માં કન્વર્ટ કરો

જો તમે ફક્ત એચટીએમએલ તત્વ જેમ કે ડીવી અથવા સ્પ spન સીધા રૂપાંતરિત કરવા માંગો છો intOa વર્ડ દસ્તાવેજ તમે GrabzIt ની ASP.NET લાઇબ્રેરી સાથે કરી શકો છો. તમારે પાસ કરવું આવશ્યક છે સીએસએસ પસંદગીકાર તમે HTML માં કન્વર્ટ કરવા માંગો છો તે HTML ઘટક છે setTargetElement ની પદ્ધતિ DOCXOptions વર્ગ.

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

આ ઉદાહરણમાં, અમે સ્પેનમાં બધી સામગ્રી કેપ્ચર કરવા માંગીએ છીએ જેની આઈડી છે Article, તેથી અમે નીચે બતાવ્યા પ્રમાણે તેને GrabzIt API પર પસાર કરીએ છીએ.

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

DOCXOptions options = new DOCXOptions();
options.setTargetElement("#Article");

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