pdfmark | MOVED TO https : //gitlab.com/crossref/pdfmark | Continuous Deployment library
kandi X-RAY | pdfmark Summary
kandi X-RAY | pdfmark Summary
2018/01/15: pdfmark is not working with Java 9. You must use 8 or below. To run with Docker. You should find a file named '/tmp/test-pdf_xmp.pdf'.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Writes information dictionary to specified output file
- Extracts all XMP schemas from a blob
- Parses an RdfList element
- Get namespace declarations
- Parse an rdf element
- Extracts key - value pairs from a PDF document
- Writes a XMP schema set to the document
- Get the titles of a node
- Returns the preferred ISSN element
- Process the unix reference
- Evaluates the XPath expression
- Adds a list of values to a schema object
- Grab metadata for a specific doi
- Logs the error with the given code and error code
- Merge two Xmp descriptions
- Checks if a PDF file is Linearized
- Main method for testing
- Writes a XMP SchemaSet to the output stream
- Read the entire file
- Get the namespace URI declaration of an element
pdfmark Key Features
pdfmark Examples and Code Snippets
Community Discussions
Trending Discussions on pdfmark
QUESTION
I was trying to automate adding title, bookmarks and such to some PDFs I need. The way I came up with was to create a simple pdfmark
script like this:
ANSWER
Answered 2021-Apr-01 at 16:18I'll leave PostScript to others and show how to remove a PDF outline using the qpdf package (for qpdf
and fix-qdf
) and GNU sed
.
From the qpdf
manual:
In QDF mode, qpdf creates PDF files in what we call QDF form. A PDF file in QDF form, sometimes called a QDF file, is a completely valid PDF file that has
%QDF-1.0
as its third line (after the pdf header and binary characters) and has certain other characteristics. The purpose of QDF form is to make it possible to edit PDF files, with some restrictions, in an ordinary text editor.
(For a non-GNU/Linux system adapt the commands below.)
QUESTION
I'm setting metadata on PDFs using Ghostscript and pdfmarks. I'm able to set just about everything I need IE: Title, Author, Bookmarks, etc using pdfmarks. However, I can not set the Natural Language. I'm sure I'm just missing the correct syntax, as I've looked over Adobe documentation and see it listed in there.
This is what I have tried:
...ANSWER
Answered 2020-Sep-06 at 13:58That's a logical structure pdfmark StPNE
, but the last pdfmark reference I can find (version 9 from 2008) does not list /Lang as a legal attribute for a logical structure pdfmark.
I note that the PDF specification does permit /Lang to be a member of a logical structure element, but that doesn't mean there's a pdfmark for it. I think Adobe stopped updating the pdfmark reference with new content for new versions of the PDF specification.
/Type /Catalog won't be legal either.
Can you explain which part of the resulting PDF you are trying to add this to ? Ghostscript only implements the pdfmarks listed in the pdfmark refrence, and I don't think it fully implements all of those currently.
[EDIT]
I just checked and Ghostscript's pdfwrite device does not implement the StPNE pdfmark at all, so that's not going to do anything.
[further edit]
It may be (looking at the PDF specification) that what you want is to set a key called /Lang in the Catalog object of the PDF file. Obviously I'm not certain but....
QUESTION
I'm using a service that requires all PDF pages to be the same exact size. Right now, the second page of my PDF is US letter size, but the first page is a little smaller than that - I would like the first page to be letter size as well.
Here's a sample PDF of what I'm starting with. Here's what pdfinfo
says about this file to start with:
ANSWER
Answered 2020-Jun-05 at 17:15Well, I found this answer that includes a method to remove CropBoxes using sed
(!), which seems to be working for me:
QUESTION
I want Ghostscript to prepare PDFs for print production. The input PDF (Version 1.3) is in RGB, uses transparency and has crop marks.
- Convert colors to CMYK by applying an ICC profile
- Add a TrimBox and a BleedBox
I managed to achieve the steps above using the following command:
...ANSWER
Answered 2020-Apr-28 at 15:52OK a few points:
Ghostscript (and more particularly the pdfwrite device) doesn't add anything to PDF files. It makes brand new PDF files from the supplied input, whcih may or may not be a PDF file.
The process is described here and I'd suggest you read it. Essentially you cannot assume that the conent of the produced PDF file bears any relationship at all to the conent of the input, if its a PDF file.
Your usage of ICC profiles is not causing the conversion to CMYK, that's done by setting ColorConversionStrategy. Your setting of OverrideICC and OutputICCProfile aren't doing anything and you shold remove those switches. In addition you should not set ProcessColorModel if you are setting ColorConversionStrategy. Similarly setting RenderIntent does nothing at all with the pdfwrite device, drop that too.
Don't set the resolution. All that does is set the resolution of any content which must be rendered (eg creating a PDF file < version 1.4 from an input file containing transparency). So drop the -r100.
-dPDFX doesn't cause fonts to be rasterised.
If that's happening then its almost certainly nothing to do with selecting PDFX, without seeing your input file I can't comment further.
-dPDFX is not necessary to create a PDF file with TrimBox or BleedBox.
Of course, what your PostScript actually does is create PDFX Bleed and Trim Offsets, and yes, if you want those then you need to set PDFX, clearly. OTOH if you actually wnt to set normal regular Bleed or Trim boxes then that is also documented in the pdfmark reference (see page 37 of the 1.7 pdfmark reference):
The syntax for specifying a non-default page cropping for a particular page in a document is as follows: [ /CropBox [xll yll xur yur] /PAGE pdfmark The syntax for specifying the default page cropping for a document is as follows: [ /CropBox [xll yll xur yur] /PAGES pdfmark
Obviously you would Susbsitute Bleed or Trim for CropBox.
[Later]
This command line:
QUESTION
Can anyone confirm the following behaviour on MacOS 10.13 High Sierra with GhostScript? I don't get the problem when using 10.12 Sierra.
When I create PDFs in GhostScript, it always leaves the Title, Author and other metadata blank.
I know that you can set the metadata with PDFmarks within the PostScript file itself (or a secondary merged PS file that just contains PDFmarks), but that requires manually setting the field for each file.
Currently, my PDFs fail PDF-X validation until I manually add the metadata.
My PostScript does contain DSC comments, and the GS documentation implies that this should be picked up, as ParseDSCCommentsForDocInfo
is true by default.
ANSWER
Answered 2019-Jan-25 at 13:36As of MacOS Mojave 10.14.3 and GhostScript version 9.26, this now fixed. I can only presume it was a bug in GhostScript or MacOS.
QUESTION
I'm converting a series of Illustrator files into a single PDF document using Ghostscript.
In that generated pdf document, I'm trying to apply an external link to the last page of the file. To do that I've created a separate script.ps with the following rules:
...ANSWER
Answered 2018-Dec-21 at 09:07I think your problem is that you are executing the pdfmark before you execute the remaining page descriptions (by the way, beware of using Adobe Illustrator '.ai' files, these are not guaranteed to be valid self-contained PostScript).
At the time you execute the pdfmark, there are no pages yet defined, so there's no way to translate the page number into the PDF object number which will contain the description of page 5.
Try running your 'script.ps' as the final operation, not the first.
QUESTION
I know from some colleagues, who are desiging our leaflets in Indesign and store as PDF's that there is a setting to view it in full page mode, when opening the file.
I did a script to "merge" some of these docs using ghostscript device -pdfwriter and option -dPDFFitPage (edited after KenS' answer)
here my full command:
...ANSWER
Answered 2018-Oct-01 at 12:26There is no option -dpdfwriter. The fact that PDFFitPage doesn't do what you want isn't surprising, it has no effect on what a PDF viewer will do. This option (which is described in the documentation) only has any effect when used with a pre-defined fixed media size. It creates a new PDF where the content of the original PDF is scaled so that fits onto the fixed media size.
If you want to include directions to PDF viewers on how to open PDF documents then you need to look at the pdfmark operator. Specifically you will need to construct a DOCVIEW pdfmark as described on page 29 and 30 of the version 9 pdfmark reference.
QUESTION
We try to add a small link to a large PDF 50 pages and more. The command
...ANSWER
Answered 2018-Oct-04 at 12:11You can't. The way Ghostscript and the pdfwrite device work is described in ghostpdl/doc/VectorDevices.htm or here.
I'd suggest you read that to see why this isn't possible, and also to gain some understanding of what's actually going on. You are not simply 'adding a link' you are creating a completely new PDF file, whose contents (at the file level) may bear no relation to the original PDF file's contents.
Ghostscript + pdfwrite is not a 'PDF editor'/
QUESTION
I have a problem with pdfmarks when "merging" PDF's with ghostscript 9.22. I have following situation:
cover.pdfIn the properties of the document is mentioned
Title : cover.docx
Author: Edmond Egg
input1.pdfIn the properties of the document is mentioned
Title : input1.docx
Author: Charly Cheese
input2.pdfIn the properties of the document is mentioned
Title : input2.docx
Author: Susanna Sausage
input3.pdfIn the properties of the document is mentioned
Title : input3.docx
Author: Martha Meet
pdfmarks ...ANSWER
Answered 2018-Sep-28 at 02:41Your DocInfo pdfmarks are incorrect.
You've put :
QUESTION
I am trying to reset the form fields (on a button click) created using PDFmarks in the post script, I have tried the samples shared in the pdfmarks reference manual with no luck (after distling through acrobat it does not do so). Could someone please share a sample or let me know what i am doing wrong
My sample code is :-
...ANSWER
Answered 2018-May-28 at 05:28Issue got resolved, NeedAppearances=true flag in the acroform dictionary was not set due to which reset button was not displaying correctly and reset form action was also not getting executed (interestingly text and combo fields were working fine even without this flag)
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install pdfmark
You can use pdfmark 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 pdfmark 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