我想将PDF转换为JPEG:
$ convert pdf-test.pdf pdf-test.pdf.jpg
Run Code Online (Sandbox Code Playgroud)
但是,我收到此错误:
convert: Postscript delegate failed `pdf-test.pdf': No such file or directory @ error/pdf.c/ReadPDFImage/664.
convert: missing an image filename `pdf-test.pdf.jpg' @ error/convert.c/ConvertImageCommand/3015.
Run Code Online (Sandbox Code Playgroud)
目前我在Mac OS X Lion上使用此版本的GS和ImageMagick:
$ gs -v
GPL Ghostscript 9.02 (2011-03-30)
Copyright (C) 2010 Artifex Software, Inc. All rights reserved.
$ convert -version
Version: ImageMagick 6.7.1-1 2011-07-21 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2011 ImageMagick Studio LLC
Features: OpenMP
Run Code Online (Sandbox Code Playgroud)
有人可以开导我这个吗?
我正在尝试使用用户数据启动aws实例.我的用户数据是服务器安装过程,我必须检查用户数据脚本是否正确执行.有没有选项可以检查用户数据的状态是否已完成?我需要知道自从启动的实例以来我正在拍摄另一张图片的状态.现在,我明确地使用time.sleep(90)来完成我的流程.
注意:我正在使用Boto库.
任何解决方案都将非常感谢!
所以我在javascript中得到了这个代码来从网上计算不规则多边形区域.
function polygonArea(X, Y, numPoints)
{
area = 0; // Accumulates area in the loop
j = numPoints-1; // The last vertex is the 'previous' one to the first
for (i=0; i<numPoints; i++)
{ area = area + (X[j]+X[i]) * (Y[j]-Y[i]);
j = i; //j is previous vertex to i
}
return area/2;
}
var xPts = [3, 3, 2, 2, 3, 3, 6, 6, 9, 9, 4, 4 ];
var yPts = [2, 4, 4, 5, 5, 6, 6, …Run Code Online (Sandbox Code Playgroud) 我正在使用GS进行从PDF到JPEG的转换,以下是我使用的命令:
gs -sDEVICE=jpeg -dNOPAUSE -dBATCH -g500x300 -dPDFFitPage -sOutputFile=image.jpg image.pdf
Run Code Online (Sandbox Code Playgroud)
在此命令中,您可以看到-g500x300设置转换后的图像大小(宽度x高度).
有没有办法只需设置宽度而不必输入高度,那么它将基于宽度来使用其原始宽高比来缩放高度?我知道它可以通过使用ImageMagick转换来实现,你只需要放置0高度参数即-resize 500x0.我尝试使用GhostScript,但我不认为这是正确的方法.
我决定不使用ImageMagick转换原因,因为它在转换大尺寸多页PDF时非常慢.
谢谢您的帮助!
我面临以下代码的问题
try {
DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
//root elements
Document doc = docBuilder.newDocument();
Element rootElement = doc.createElement("subcompany");
doc.appendChild(rootElement);
//id elements
Element id = doc.createElement("id");
id.appendChild(doc.createTextNode(subCompanyId != null ? subCompanyId : " "));
rootElement.appendChild(id);
TransformerFactory transformerFactory = TransformerFactory.newInstance();
Transformer transformer = transformerFactory.newTransformer();
DOMSource source = new DOMSource(doc);
transformer.setOutputProperty(OutputKeys.INDENT, "yes");
transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
String xmlPath = "/project/MallDirectory/mall";
//EDITED for File creation before writing.
boolean isFileCreated = new File(xmlPath, "subcompany.xml").createNewFile();
System.out.println(isFileCreated);
StreamResult result = new StreamResult(new File(xmlPath, "subcompany.xml"));
transformer.transform(source, result); …Run Code Online (Sandbox Code Playgroud) 我在MySQL DB中有一个表,上面有一date(DATETIME)列.如果让我说我想查询记录在哪里,我如何用java Hibernate标准表达呢NOW() < ('date' + 1 day)?
实际上我想将我现有的Ghostscript从版本9.02更新到9.05最新版本.当我在9.05包内运行make时,我得到以下错误:
if [ x != x ]; then LD_RUN_PATH=; export LD_RUN_PATH; fi; \ XCFLAGS= XINCLUDE= XLDFLAGS= XLIBDIRS= XLIBS= \ FEATURE_DEVS= DEVICE_DEVS= DEVICE_DEVS1= DEVICE_DEVS2= DEVICE_DEVS3= \ DEVICE_DEVS4= DEVICE_DEVS5= DEVICE_DEVS6= DEVICE_DEVS7= DEVICE_DEVS8= \ DEVICE_DEVS9= DEVICE_DEVS10= DEVICE_DEVS11= DEVICE_DEVS12= \ DEVICE_DEVS13= DEVICE_DEVS14= DEVICE_DEVS15= DEVICE_DEVS16= \ DEVICE_DEVS17= DEVICE_DEVS18= DEVICE_DEVS19= DEVICE_DEVS20= \ DEVICE_DEVS_EXTRA= \ /bin/sh <./obj/ldt.tr Undefined symbols for architecture x86_64: "_iconv_open", referenced from:
_opvp_to_utf8 in gdevopvp.o "_iconv", referenced from:
_opvp_to_utf8 in gdevopvp.o "_iconv_close", referenced from:
_opvp_to_utf8 in gdevopvp.o ld: symbol(s) not found for architecture x86_64 …Run Code Online (Sandbox Code Playgroud) ghostscript ×3
java ×2
jpeg ×2
pdf ×2
amazon-ec2 ×1
boto ×1
hibernate ×1
imagemagick ×1
javascript ×1
macos ×1
math ×1
mysql ×1
postscript ×1
xml ×1