资源简介
phantomjs html转pdf 完美版本 可以把 html 非常完美的转成pdf,与浏览器转换出来的一样完美
代码片段和文件信息
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License Version 2.0 (the
“License“); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing
software distributed under the License is distributed on an
“AS IS“ BASIS WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
*/
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.net.URL;
import java.nio.channels.Channels;
import java.nio.channels.ReadableByteChannel;
import java.util.Properties;
public class MavenWrapperDownloader {
/**
* Default URL to download the maven-wrapper.jar from if no ‘downloadUrl‘ is provided.
*/
private static final String DEFAULT_DOWNLOAD_URL =
“https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar“;
/**
* Path to the maven-wrapper.properties file which might contain a downloadUrl property to
* use instead of the default one.
*/
private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
“.mvn/wrapper/maven-wrapper.properties“;
/**
* Path where the maven-wrapper.jar will be saved to.
*/
private static final String MAVEN_WRAPPER_JAR_PATH =
“.mvn/wrapper/maven-wrapper.jar“;
/**
* Name of the property which should be used to override the default download url for the wrapper.
*/
private static final String PROPERTY_NAME_WRAPPER_URL = “wrapperUrl“;
public static void main(String args[]) {
System.out.println(“- Downloader started“);
File baseDirectory = new File(args[0]);
System.out.println(“- Using base directory: “ + baseDirectory.getAbsolutePath());
// If the maven-wrapper.properties exists read it and check if it contains a custom
// wrapperUrl parameter.
File mavenWrapperPropertyFile = new File(baseDirectory MAVEN_WRAPPER_PROPERTIES_PATH);
String url = DEFAULT_DOWNLOAD_URL;
if (mavenWrapperPropertyFile.exists()) {
FileInputStream mavenWrapperPropertyFileInputStream = null;
try {
mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
Properties mavenWrapperProperties = new Properties();
mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL url);
} catch (IOException e) {
Syst
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2019-04-17 16:06 demo_pdf\
文件 303 2019-04-16 16:34 demo_pdf\.gitignore
目录 0 2019-04-19 16:24 demo_pdf\.idea\
文件 643 2019-04-16 16:34 demo_pdf\.idea\compiler.xm
文件 177 2019-04-16 16:34 demo_pdf\.idea\encodings.xm
目录 0 2019-04-17 16:06 demo_pdf\.idea\libraries\
文件 568 2019-04-16 16:34 demo_pdf\.idea\libraries\Maven__ch_qos_logback_logback_classic_1_2_3.xm
文件 547 2019-04-16 16:34 demo_pdf\.idea\libraries\Maven__ch_qos_logback_logback_core_1_2_3.xm
文件 522 2019-04-16 16:34 demo_pdf\.idea\libraries\Maven__com_fasterxm
文件 644 2019-04-16 16:34 demo_pdf\.idea\libraries\Maven__com_fasterxm
文件 595 2019-04-16 16:34 demo_pdf\.idea\libraries\Maven__com_fasterxm
文件 623 2019-04-16 16:34 demo_pdf\.idea\libraries\Maven__com_fasterxm
文件 674 2019-04-16 16:34 demo_pdf\.idea\libraries\Maven__com_fasterxm
文件 688 2019-04-16 16:34 demo_pdf\.idea\libraries\Maven__com_fasterxm
文件 729 2019-04-16 16:34 demo_pdf\.idea\libraries\Maven__com_fasterxm
文件 546 2019-04-16 16:34 demo_pdf\.idea\libraries\Maven__com_jayway_jsonpath_json_path_2_4_0.xm
文件 700 2019-04-16 16:34 demo_pdf\.idea\libraries\Maven__com_vaadin_external_google_android_json_0_0_20131108_vaadin1.xm
文件 611 2019-04-16 16:34 demo_pdf\.idea\libraries\Maven__javax_annotation_javax_annotation_api_1_3_2.xm
文件 611 2019-04-16 16:34 demo_pdf\.idea\libraries\Maven__javax_validation_validation_api_2_0_1_Final.xm
文件 455 2019-04-16 16:34 demo_pdf\.idea\libraries\Maven__junit_junit_4_12.xm
文件 536 2019-04-16 16:34 demo_pdf\.idea\libraries\Maven__net_bytebuddy_byte_buddy_1_9_12.xm
文件 578 2019-04-16 16:34 demo_pdf\.idea\libraries\Maven__net_bytebuddy_byte_buddy_agent_1_9_12.xm
文件 542 2019-04-16 16:34 demo_pdf\.idea\libraries\Maven__net_minidev_accessors_smart_1_2.xm
文件 507 2019-04-16 16:34 demo_pdf\.idea\libraries\Maven__net_minidev_json_smart_2_3.xm
文件 573 2019-04-16 16:34 demo_pdf\.idea\libraries\Maven__org_apache_logging_log4j_log4j_api_2_11_2.xm
文件 608 2019-04-16 16:34 demo_pdf\.idea\libraries\Maven__org_apache_logging_log4j_log4j_to_slf4j_2_11_2.xm
文件 625 2019-04-16 16:34 demo_pdf\.idea\libraries\Maven__org_apache_tomcat_em
文件 611 2019-04-16 16:34 demo_pdf\.idea\libraries\Maven__org_apache_tomcat_em
文件 660 2019-04-16 16:34 demo_pdf\.idea\libraries\Maven__org_apache_tomcat_em
文件 542 2019-04-16 16:34 demo_pdf\.idea\libraries\Maven__org_assertj_assertj_core_3_11_1.xm
文件 532 2019-04-16 16:34 demo_pdf\.idea\libraries\Maven__org_hamcrest_hamcrest_core_1_3.xm
............此处省略91个文件信息
相关资源
- 网页音乐播放器 html5 实验报告
- H+ 后台主题UI框架
- 京东网页代码
- 李炎恢HTML5第一季讲义课件+代码超全
- 使用iText-2.0.8将Html转换为pdf,带图片
- html5的ppt课件及代码
- 一款HTML模板,非常适合做SEO
- 写个一个简单的web项目把前端技术:
- 李炎恢 xhtml 课程 素材源代码
- html5 汤姆猫
- 电商-书店基础版HTML静态页面
- 最新精美后台管理系统模版html源文件
- BOSS - Multipurpose Template
-
疯狂HTML5CSS3ja
vasc ript讲义_源码 - Html5代码_微信H5微场景10个)源码
- HTML大作业源码
- HTML5+CSS3网站设计基础教程 传智播客全
- 纯HTML+CSS的旅游网
- html静态网页导航条、表格、表单、音
- 电商网站前端页面
- xiaomi.zip
- html转pdf工具
- 15套HTML5微场景源码
- 简单的HTML我的家乡+doc文档
- 学生个人网站
-
《HTML CSS ja
vasc ript 网页制作从入门 -
网页设计与制作教程HTML+CSS+ja
vasc< - 中秋博饼模板html 可以看看
- 一个汽车类DIV+css布局的html网站
- html5-bluetooth-demo
评论
共有 条评论