我想通过将HTML内容传递给函数来生成PDF.我已经为此使用了iTextSharp,但是当它遇到表格并且布局变得混乱时它表现不佳.
有没有更好的办法?
我有UTF-8的文件名,git处理它们好,它会正确创建文件,github页面也显示正确.除了它将在下面的控制台中显示它.是否可以在控制台中正确显示git在ASCII 127之外显示UTF-8编码字符?
git status
# On branch master
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: .gitignore
# modified: editfile.js
# modified: "\321\203\321\201\321\202\320\260\320\275\320\276\320\262"
#
no changes added to commit (use "git add" and/or "git commit -a")
Run Code Online (Sandbox Code Playgroud)
UPDATE
我被问到我的语言环境,这里是locale命令的输出
LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
Run Code Online (Sandbox Code Playgroud) 我Missing blame information for the following files在SonarQube的分析过程中收到了警告.
[INFO] [22:19:57.714] Sensor SCM Sensor
[INFO] [22:19:57.715] SCM provider for this project is: git
[INFO] [22:19:57.715] 48 files to be analyzed
[INFO] [22:19:58.448] 0/48 files analyzed
[WARN] [22:19:58.448] Missing blame information for the following files:
(snip 48 lines)
[WARN] [22:19:58.449] This may lead to missing/broken features in SonarQube
[INFO] [22:19:58.449] Sensor SCM Sensor (done) | time=735ms
Run Code Online (Sandbox Code Playgroud)
我正在使用SonarQube 5.5,分析由Maven在Jenkins工作中完成,在多模块Java项目上完成.安装了Git插件1.2.
在bash shell中,在任何有问题的文件上手动运行git blame,都会给出预期的输出.
我发现的相关问题都与SVN有关,我的问题在于Git.
我怎样才能获得关于Sonarqube的git blame信息?
通过使用apache POI如何将ms word文件转换为pdf?
我使用以下代码,但它没有工作给出错误,我想我正在导入错误的类?
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.OutputStream;
import org.apache.poi.hslf.record.Document;
import org.apache.poi.hwpf.HWPFDocument;
import org.apache.poi.hwpf.extractor.WordExtractor;
import org.apache.poi.hwpf.usermodel.Paragraph;
import org.apache.poi.hwpf.usermodel.Range;
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
public class TestCon {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
POIFSFileSystem fs = null;
Document document = new Document();
try {
System.out.println("Starting the test");
fs = new POIFSFileSystem(new FileInputStream("/document/test2.doc"));
HWPFDocument doc = new HWPFDocument(fs);
WordExtractor we = new WordExtractor(doc);
OutputStream …Run Code Online (Sandbox Code Playgroud) Jenkins插件之一作为依赖项拖入Checks API ,现在每个构建的底部都有这条烦人的消息:
[Checks API] No suitable checks publisher found.
Run Code Online (Sandbox Code Playgroud)
这本身不会导致任何构建失败。这只是烦人的噪音,我不想要它。
现在每次构建由于任何其他原因失败时,我的开发人员都会告诉我
看来我们在 foobar 机器上构建时遇到了问题,再次出现“没有找到合适的检查发布者”错误。
这是不正确的,实际错误正好高于或低于该警告。
这是浪费时间,我再也不想看到那个警告了。我该如何摆脱它?
我无法卸载Checks API,它呈灰色。JUnit和警告下一代需要它作为依赖项。
我正在一个Vagrant框中安装Gitlab-ce Omnibus(Debian 18.04 LTS).在我的配置脚本中,我运行gitlab-ctl reconfigure.我收到一个错误:
initdb:编码不匹配
控制台输出:
default: * execute[/opt/gitlab/embedded/bin/initdb -D /var/opt/gitlab/postgresql/data -E UTF8] action run
default:
default: [execute] The files belonging to this database system will be owned by user "gitlab-psql".
default: This user must also own the server process.
default:
default: The database cluster will be initialized with locale "en_US".
default: initdb: encoding mismatch
default: The encoding you selected (UTF8) and the encoding that the
default: selected locale uses (LATIN1) do not match. This would lead …Run Code Online (Sandbox Code Playgroud) 我有一个 android 应用程序,它基本上是一个接受用户输入的表单。此输入存储在数据库中。但我想用用户输入的信息创建一个 pdf 文件并显示它,以便用户可以打印文件或将文件保存到他们的 android 笔记选项卡。最好的方法是什么。我已经看到了 iText,但这不会呈现文件。我在网上找到了这段代码,并对其进行了测试以了解pdf创建的概念。这使用了 Lowagie 2.1.7
package com.example.sweetiean.androidpdfdemo;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.net.Uri;
import android.os.Environment;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;
import com.lowagie.text.Document;
import com.lowagie.text.DocumentException;
import com.lowagie.text.Font;
import com.lowagie.text.HeaderFooter;
import com.lowagie.text.Paragraph;
import com.lowagie.text.Phrase;
import com.lowagie.text.pdf.PdfWriter;
import com.lowagie.text.Image;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
public class MainActivity extends ActionBarActivity {
private Button createPDF , openPDF;
@Override
protected void onCreate(Bundle savedInstanceState) …Run Code Online (Sandbox Code Playgroud) 我在Jenkins管道中有这个阶段:
stage('Build') {
def mvnHome = tool 'M3'
sh '''for f in i7j-*; do
(cd $f && ${mvnHome}/bin/mvn clean package)
done
wait'''
}
Run Code Online (Sandbox Code Playgroud)
在Jenkins»管理Jenkins»全局工具配置我有一个叫做M3版本的Maven安装3.3.9.
运行此管道时,mvnHome为空,因为我在日志中得到了这个:
+ /bin/mvn clean install -Dmaven.test.skip=true
/var/lib/jenkins/jobs/***SNIP***/script.sh: 3: /var/lib/jenkins/jobs/***SNIP***/script.sh: /bin/mvn: not found
Run Code Online (Sandbox Code Playgroud)
我确实/var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/M3在Jenkins服务器上找到了一条路径,但是我不想在这个脚本中使用mvn的硬编码路径.
我该如何解决?
编辑:答案摘要,使用tool和withEnv.
我的工作代码现在是:
stage('Build') {
def mvn_version = 'M3'
withEnv( ["PATH+MAVEN=${tool mvn_version}/bin"] ) {
sh '''for f in i7j-*; do
(cd $f && mvn clean package …Run Code Online (Sandbox Code Playgroud) 我想在Java中使用iText 7.想要将HTML/XHTML转换为PDF.
显然xmlworker.jar不存在iText 7 core.
什么是iText 7的替代品?
有解决方案吗
我正在 Jenkins 中使用多分支管道项目。我让詹金斯为新分支建立索引。我需要 Jenkins 等待多分支管道项目的索引完成。
这是我当前的代码:
def triggerScanMultibranchPipeline(projectDir, repo) {
def multibranchProject = Jenkins.instance.getItemByFullName "$projectDir/$repo"
multibranchProject.scheduleBuild()
while (multibranchProject == null || multibranchProject.isDisabled()) {
sleep 1000 //1000 milliseconds = 1 second
}
sleep time: 1, unit: 'SECONDS'
}
Run Code Online (Sandbox Code Playgroud)
已经尝试过:
triggerScanMultibranchPipeline这会增加每次调用时构建的持续时间。
我无法用于"wait: true"完成索引,因为不支持等待非作业项目。请参阅https://github.com/jenkinsci/pipeline-build-step-plugin/blob/pipeline-build-step-2.13/src/main/java/org/jenkinsci/plugins/workflow/support/steps/build/BuildTriggerStepExecution .java#L80
如何让Jenkins等到多分支管道项目的分支索引完成?