时光荏苒,记忆犹新!
<repositories> <repository> <id>jitpack.io</id> <url>https://jitpack.io</url> </repository> </repositories>
<dependencies> <dependency> <groupId>com.github.Cloudmersive</groupId> <artifactId>Cloudmersive.APIClient.Java</artifactId> <version>v4.25</version> </dependency> </dependencies>
allprojects { repositories { ... maven { url 'https://jitpack.io' } } }
dependencies { implementation 'com.github.Cloudmersive:Cloudmersive.APIClient.Java:v4.25' }
// Import classes: //import com.cloudmersive.client.invoker.ApiClient; //import com.cloudmersive.client.invoker.ApiException; //import com.cloudmersive.client.invoker.Configuration; //import com.cloudmersive.client.invoker.auth.*; //import com.cloudmersive.client.ConvertDocumentApi; ApiClient defaultClient = Configuration.getDefaultApiClient(); // Configure API key authorization: Apikey ApiKeyAuth Apikey = (ApiKeyAuth) defaultClient.getAuthentication("Apikey"); Apikey.setApiKey("YOUR API KEY"); // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //Apikey.setApiKeyPrefix("Token"); ConvertDocumentApi apiInstance = new ConvertDocumentApi(); File inputFile = new File("/path/to/inputfile"); // File | Input file to perform the operation on. try { TextConversionResult result = apiInstance.convertDocumentHtmlToTxt(inputFile); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling ConvertDocumentApi#convertDocumentHtmlToTxt"); e.printStackTrace(); }
<?xml version="1.0" encoding="UTF-8"?> <HtmlToTextRequest> <Html>string</Html> </HtmlToTextRequest>
// Import classes: //import com.cloudmersive.client.invoker.ApiClient; //import com.cloudmersive.client.invoker.ApiException; //import com.cloudmersive.client.invoker.Configuration; //import com.cloudmersive.client.invoker.auth.*; //import com.cloudmersive.client.ConvertWebApi; ApiClient defaultClient = Configuration.getDefaultApiClient(); // Configure API key authorization: Apikey ApiKeyAuth Apikey = (ApiKeyAuth) defaultClient.getAuthentication("Apikey"); Apikey.setApiKey("YOUR API KEY"); // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //Apikey.setApiKeyPrefix("Token"); ConvertWebApi apiInstance = new ConvertWebApi(); HtmlToTextRequest input = new HtmlToTextRequest(); // HtmlToTextRequest | HTML to Text request parameters try { HtmlToTextResponse result = apiInstance.convertWebHtmlToTxt_0(input); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling ConvertWebApi#convertWebHtmlToTxt_0"); e.printStackTrace(); }
<?xml version="1.0" encoding="UTF-8"?> <RemoveHtmlFromTextRequest> <TextContainingHtml>string</TextContainingHtml> </RemoveHtmlFromTextRequest>
// Import classes: //import com.cloudmersive.client.invoker.ApiClient; //import com.cloudmersive.client.invoker.ApiException; //import com.cloudmersive.client.invoker.Configuration; //import com.cloudmersive.client.invoker.auth.*; //import com.cloudmersive.client.EditTextApi; ApiClient defaultClient = Configuration.getDefaultApiClient(); // Configure API key authorization: Apikey ApiKeyAuth Apikey = (ApiKeyAuth) defaultClient.getAuthentication("Apikey"); Apikey.setApiKey("YOUR API KEY"); // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) //Apikey.setApiKeyPrefix("Token"); EditTextApi apiInstance = new EditTextApi(); RemoveHtmlFromTextRequest request = new RemoveHtmlFromTextRequest(); // RemoveHtmlFromTextRequest | Input request try { RemoveHtmlFromTextResponse result = apiInstance.editTextRemoveHtml(request); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling EditTextApi#editTextRemoveHtml"); e.printStackTrace(); }
本文由本站原创或投稿者首发,转载请注明来源!
本文链接:http://www.ziti66.com/net/html/167.html
下面有请小扒菜。。。
本站投稿暂时请将内容发送至指定邮箱,审核内容健康后放出,原创内容将优先置顶展现!
邮箱:liye1122#126.com
❤安全运行天 Copyright © 2018-2025 66字体网 版权所有.
本站采用创作共用版权 CC BY-NC-SA 3.0 CN 许可协议,转载或复制请注明出处