artifex | a library for constructing geometric data | Data Manipulation library
kandi X-RAY | artifex Summary
kandi X-RAY | artifex Summary
A library for building geometric data.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Convert a matrix to a serpentine matrix
- Multiply two matrices
- Wrap a path
- Calculate the miter between two vectors
- Deduplicate coordinates on a curve
- Adds two doubles
- Return the string representation of the faces
- Get a list of all the faces in this face
- Create a path curve from vertices
- Create a vector from a double array
- Compares two matrices
- Divide interval
- Compares Box with Box
- Gets the angle between two vectors
- Returns the distance between this segment and the given point
- Walks through a set of vertices and returns the shortest path
- Compute the coefficients for a Cubic curve
- Returns a string representation of the index
- Intersection of two curves
- Returns a list of possible combinations
- Creates a cyclic matrix to be used
- Returns a list of vertices with the specified error
- Computes the cuspian matrix
- Calculates the width of a line
artifex Key Features
artifex Examples and Code Snippets
Community Discussions
Trending Discussions on artifex
QUESTION
I've been using Ghostscript in the command line with
...ANSWER
Answered 2021-Nov-09 at 11:58Easily done but read the error undefinedfilename in (sDEVICE=pdfwrite)
Whilst not very clear, it thinks you are asking for that file to be processed.
However you should have just like for the -o output file switch added the switch - signal.
Then if there is no IN file the message changes
QUESTION
I am trying to build a multipage PDF using Ghostscript by combining a list of single-page PDFs from their UNC file-paths (working in Python 3.7). Here is the function:
...ANSWER
Answered 2021-Oct-16 at 00:51The following command outside python runs for me no problem.
QUESTION
I was trying to convert jpg to pdf using ghost script. The command which I was using was
...ANSWER
Answered 2021-Jul-05 at 03:32There are several ways to convert image to PDF and this is possibly not the best way to convert Jpeg to PDF in Ghostscript, but you asked why it did not work for you.
The following should in a cmd file, first work per the example, once proven then try changing the <> of the last line that you think need altering. Note that long lines are very fragile and there must be NO space after ^
Also the order and combinations can easily throw GS into an error state.
CMD Filenames are best always "FullPath\quoted" and if you don't want to inititally CD
to the output directory (to make it much easier to avoid using escaped name) then change the start of last line to
-c "("C:\\Users\\kbged\\Pictures\\group_image.jpg") <<......
Beware the much simpler method would be to write your own input.PS to avoid potential command line truncation.
QUESTION
I have bash script that takes a booklet format PDF and converts it to separate pages. The script is called by php running under nginx.
I am using pdfcrop, which calls pdfTex, which is the point of failure.
The script runs fine as root from the command line. However, when run by nginx (the script is called via php) it fails when pdfcrop calls pdfTex.
Here is the line for the failure point:
...ANSWER
Answered 2021-Feb-07 at 23:02My original theory that pdfTex was not available to the nginx user was correct.
In my script, I logged the result of which pdftex
. This command returned not found. The solution was to create a symlink to the pdftex script. I did this by adding the following to my script.
QUESTION
I've been trying for a few hours now solve this problem and I looked everywhere for a solution and I did not find one. I'm trying to run a spec test for my project and I have the following error coming up:
...ANSWER
Answered 2021-Jan-14 at 14:33I managed to figure out a solution. Looking for the code for the Rghost, what I saw in its spec is that the path expected was different than the path the ghostscript really is. When I run whereis or which on my terminal, it returns:
QUESTION
$ command gs
GPL Ghostscript 8.70 (2009-07-31)
Copyright (C) 2009 Artifex Software, Inc. All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
GPL Ghostscript 8.70: Cannot open X display `(null)'.
**** Unable to open the initial device, quitting.
$ which gs
alias gs='git status'
/opt/rh/rh-git29/root/usr/bin/git
...ANSWER
Answered 2020-Oct-27 at 09:29I was working on a company machine. The comment from @Cyrus showed that which
is aliased to alias
. Doing this worked as it should have:
QUESTION
It's that dreaded time of generating publication ready EPS files for a science manuscript submission. The data, line-art figures for plots, is in R (RStudio coupled with R version 4.02). I've meet this challenge before but on a very well populated Linux machine. Today, I am using x64 bit Windows 10 that was only installed four months ago.
The code is:
...ANSWER
Answered 2020-Sep-23 at 22:09Recent versions of Ghostscript (unfortunately you've trimmed off the version from stdout, but it's (C) 2020 so it must be fairly recent) have altered the default behaviour, because of security vulnerabilities. The default is now to run in SAFER mode (previously the default was NOSAFER). This means that PostScript programs are not permitted to open/read/write/delete files on disk.
It looks like the file you are running is encountering an invalidfileaccess error when trying to write a file. The filename it's trying to write '00002dc' isn't mentioned as the output file on the Ghostscript command line, and that's the only way Ghostscript has of inferring that a file access should be permitted. Basically if the file isn't named on the command line, and you haven't told GS that it has permission to read/write to the given directory, then it's not permitted to access that file.
You could try using -dNOSAFER, I've no real idea how to add this to gsprint, which is not part of Ghostscript, but possibly (reading the gsprint.htm file) -option "-dNOSAFER" might work.
I wouldn't really recommend that as a long-term solution though.
QUESTION
I am converting .ps file to .jpeg file using ghostscript. But the output file should be rotated by 180 degree.
I am using the below command to rotate.
gswin64c.exe -sDEVICE=jpeg -dBATCH -dNOPAUSE -dSAFER -r300x300 -sOutputFile=E:\temp\test.jpg -dEPSCrop -c "<> setpagedevice" "E:\temp\myFile.ps.
Its giving below error:
GPL Ghostscript 9.10 (2013-08-30) Copyright (C) 2013 Artifex Software, Inc. All rights reserved. This software comes with NO WARRANTY: see the file PUBLIC for details. Error: /undefined in E:\temp\myFile.ps Operand stack:
Execution stack: %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-
- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- fa lse 1 %stopped_push .runexec2 --nostringval-- --nostringval-- --nost ringval-- 2 %stopped_push --nostringval-- Dictionary stack: --dict:1182/1684(ro)(G)-- --dict:0/20(G)-- --dict:77/200(L)-- Current allocation mode is local Last OS error: No such file or directory GPL Ghostscript 9.10: Unrecoverable error, exit code 1
PS:- E:\temp\myFile.ps location and file exists in my system.
...ANSWER
Answered 2020-Sep-11 at 10:56You have started arbitrary PostScript by using the -c switch. From then on everything until the next switch is treated as PostScript.
Your command line does not include any '-' between the closing " and the input filename, so the input filename is treated as part of the PostScript program. Since there is no PostScript token 'E;\temp\myFile.ps' the interpreter gives you an undefined error.
Try putting a -f
(-f means treat the next thing as a filename) after the "...setpagedevice".
That said, I'm dubious this will achieve what you want anyway, it depends on what's in the input file. You've used -dEPSCrop
yet the filename has a .ps extension. Unless the file is really an EPS then EPSCrop won't have any effect. If it is an EPS then the media size will be the dimensions of the EPS BoundingBox and (I believe) the Orientation will be ignored. If the input file is not an EPS then the EPSCrop will be ignored.
You are using a very elderly version of Ghostscript (7 years old) you should really update.
QUESTION
I am using firebase functions to crop certain area of pdf and convert them to image using ghostscript [The wrapper https://www.npmjs.com/package/node-gs and compiled version of gs v9.2 "https://github.com/sina-masnadi/node-gs/tarball/master" ]
and this is the code i am using :
...ANSWER
Answered 2020-Apr-03 at 07:17In the absence of an example file (and ideally the actual command line being sent to Ghostscript) as well as the lack of the back channel output (stout and stderr) the only observation I can make is that the 'option' you refer to (actually a piece of PostScript programming) introduces PostScript input with the -c
switch but does not terminate it with -f
. That means anything which folows this on the comand line will be treated as more PostScript, which is likely to either lead to an error or a 'hang', awaiting more input.
QUESTION
I have a .bmp
image file, and always returns the error when i convert from a bitmap
:
ANSWER
Answered 2020-Jan-20 at 13:13Ghostscript doesn't process .bmp files, it accepts PDF or PostScript. You could write a PostScript program to place a .bmp image (see for example viewgif.ps) but that's not the same thing at all.
You need an image processing application such as ImageMagick, as suggested by Mark Setchell above.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install artifex
You can use artifex like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the artifex component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page