Is it possible to add custom ruler units in Illustrator via script. I am using latest version of the Illustrator that is 2020.
No, you can just change units while adding new document and units can be from the following list
Centimeters
Qs
Inches
Pixels
Millimeters
Picas
Points
For reference, Pg. No. 252 from the following link
https://www.adobe.com/content/dam/acom/en/devnet/illustrator/pdf/Illustrator_Scriptin_Reference_JavaScript_cc.pdf
Related
I have a very big screenshot (48.69 x 1220.93 cm) which I’m converting to PDF using PDFBox 2.0.4.
It works well when I open the generated PDF using the Mac Preview app, but not with Adobe Reader version 2015. It shows only a long blank page and says the dimensions are 19.17 x 200 inches. I’m aware that early versions of the PDF spec had a limit of 200 inches height. So I've tried setting the pdf version to 1.7 but it didn’t work:
org.apache.pdfbox.pdmodel.PDDocument#setVersion
org.apache.pdfbox.cos.COSDocument#setVersion
Both Adobe and Preview say the version of the pdf is 1.7. I can normally open smaller pdfs using adobe.
As #Tilman already said in his comment,
The media box is 1380 x 34609. 1 unit = 1/72 inch
Unfortunately this is beyond the size a specification conforming pdf reader has to support:
The minimum page size should be 3 by 3 units in default user space; the maximum should be 14,400 by 14,400 units. In versions of PDF earlier than 1.6, the size of the default user space unit was fixed at 1 ⁄ 72 inch, yielding a minimum of approximately 0.04 by 0.04 inch and a maximum of 200 by 200 inches. Beginning with PDF 1.6, the size of the unit may be set on a page-by-page basis; the default remains at 1/ 72 inch.
(Table C.1 – Architectural limits - ISO 32000-1)
To support a document page as large as desired here, one should use a larger default user space unit, e.g. 3/72".
How do I convert Adobe Photoshop points to pixels in CSS?
My font size is 48pt, how does that convert to pixels?
Also, are there tools that help convert photoshop psds into CSS/Html?
You can use points to declare the size of your text in css if you like, there's no need to convert. That way if your photoshop file is set up for 72ppi, you see the same size of font in both photoshop and web.
If you building mobile thou, sizes work differently. Than the best thing is to look for a guide, depending on which devices you're building for.
I believe there isn't a tool to convert photoshop pds into css/html. Although, Zeplin may helps. Zeplin is a tool to easily export assets and make guidelines for projects, but it also helps you create a css file from your screen. https://zeplin.io/ It's really nice!
If your Photoshop document is 72pixels per inch (the standard of the web). 1px = pt.
OSX renders 72 ppi (dpi), windows renders bitmaps at 96 ppi (dpi). Knowing the 72ppi or 96ppi numbers can help you work out what's going on.
Photoshop will alter the Text Point size depending on what the image ppi is set to.
However, with today's high pixel density displays the whole dpi to ppi is something of a fudge. Wikipedia has a good, but dated, article on pixels (screens) vs dots (print)
https://en.wikipedia.org/wiki/Dots_per_inch
I am trying to produce production ready pdf.
I have eps file uploaded by admin and postscript file which I generate dynamically. I include eps with in postscript file
using below script
%%BeginDocument: danske.eps
(".$bgeps_path.") run
%%EndDocument
Now my problem is, there should be 10 mm space around image.
I managed to add 10mm space into pdf via translate.
But when It goes to print, printer cuts two edges, one is with 10mm space and other with image edge.
So what I want is to allow only one edge to cut that is with 10mm space.
I tried to achieve this by playing with BoundingBox but that does help me.
BoundingBox is a comment, nothing more, and as such is usually ignored. If you want to place an EPS then you need to follow the rules for EPS inclusion. You need to set up the Current Transformation Matrix to correctly scale and position the EPS on the canvas at a minimum.
Tech Note 5022 the EPSF sepcification v3.0 has guidelines for importing EPS files on page 13, you really should read this, particularly the co-ordinate system transformation on page 16. The tech note is available here:
http://partners.adobe.com/public/developer/en/ps/5002.EPSF_Spec.pdf
I used Word 2007 to create a PDF file with an 1526px * 900px image filling a whole page. This is not the first time it's happened, but Google Docs PDF viewer absolutely mangles the colour rendering making it unusable.
I've taken screenshots at the same zoom level in Google Docs viewer and Foxit Reader.
Here's an image for comparison:
It's awful! I've tried messing about with some things, but can't find anything that can correct this issue.
In Chrome you can select "Print" and then "Save as PDF". The image quality in the saved PDF file will go up significantly, compared to the one from "Download as PDF". Google seems to be optimizing images to preserve bandwidth.
Let it be recorded here, 16 months after the present original posting by Turkeyphant and a similar posting [1] on the Docs+Drive product forum, that the problem appears to have been fixed within about the past week. Since that time, when a pdf (or Word) file is opened that resides on the Docs+Drive cloud, the file is rendered with what appears to be proper 24-bit color. The treatment whereby the color was reduced to 5 bits, which could encode 32 colors or 32 shades of gray or 16 of each, depending on the image, has been abandoned.
To the best of my knowledge the Docs+Drive staff have not announced this change, either on their Blog or on their product forum. I noticed the change a few days ago and noted it on the conversation [1].
[1] (2013-05-21) Problem in pdf-viewer with color images
https://productforums.google.com/d/msg/docs/_bdfiYgjF2s/5PDMdp9MhFQJ
It might have something to do with compression of the image in the PDF.
I mean, PDF supports JPEG2000-encoded images (JPXDecode Filter) and PDF Reference states that:
From a single JPEG2000 data stream, multiple versions of an image may
be decoded. These different versions form progressions along four
degrees of freedom: sampling resolution, color depth, band, and
location. For example, with a resolution progression, a thumbnail
version of the image may be decoded from the data, followed by a
sequence of other versions of the image, each with approximately four
times as many samples (twice the width times twice the height) as the
previous one. The last version is the full-resolution image.
Google Docs viewer might be displaying only first version of the image (with lower resolution or lower color depth) thus producing "awful" output.
Perhaps the attached pair of images will help towards clarifying what is happening with color in images that are rendered through the Google Docs pdf viewer. I inserted the Wikipedia image RGB_Color_Solid_Cube (1024*1024 pixels) into an otherwise empty Google Docs text document, converted it to pdf, and viewed the resulting pdf files two ways: once through the Google Docs+Drive pdf viewer and once through the regular pdf viewer of the Chrome or Firefox browser. Then I made screenshots. Here is the RGB Color Cube via the Docs PDF Viewer and here is the RGB Color Cube via a regular browser PDF Viewer.
The color resolution in the Docs PDF Viewer version is really awful; it looks like 64 colors at most. Maybe someone else is able to recognize this kind of rendering and identify the problem better.
This is related to compression and it's something that you can't change in the default view of Google Docs Viewer. The simple solution is to upload the PDF and just serve it from the site in an iFrame. Here is an example:
Problem Embedding Google Docs PDF Solution
Mike
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 1 year ago.
Improve this question
Is there any tool in some PDF Viewer/Editor like Acrobat, Evince, etc. where I can navigate and watch coordinates(i.e. (x,y)) of any selected point in PDF-document?
Apache PDFBox PDFDebugger 2.0.* displays PDF coordinates in the status bar. Get it here:
https://pdfbox.apache.org/download.cgi
Download the pdfbox-app-2.0.*.jar available under command line tools on above link. Then run the below command with the required file.
java -jar pdfbox-app-2.0.*.jar PDFDebugger "InputFile"
You would be able to see the coordinates by hovering the mouse on pdf page. You can select a particular page from left hand side and corresponding page will be displayed on right. Note pdf displays coordinates from lower left of the page so if you want to extract some text using these coordinates you need to subtract the y axis from the total height and then use it. In case of below example you will have to use x:47 y:(792-522)=270
The 3.0.0 version has a few extra features unrelated to this question:
https://repository.apache.org/content/groups/snapshots/org/apache/pdfbox/pdfbox-debugger/3.0.0-SNAPSHOT/
I've found that Gimp is perfect for this! It even has different units of measure, so this is my choice
To explain #michael Z's answer, I found the following works:
These steps are for paint.net, but most image manipulation programs like The Gimp should be similar:
open the pdf up in reader.
screenshot it.
paste into paint.net
choose image > flip vertical.
choose view >show rulers.
Also tick pixels.
Resize image to use inches and be 8.5 x 11 (if it's American letter) and 72 DPI.
Now use the rectangle select tool. The image is upside-down, so the upper-left of the tool is the lower-left for the .pdf and the lower right is the upper-right for the .pdf.
FYI - In Paint.Net, the bottom toolbar always shows the xy coordinates of the cursor.
It makes your eyes a bit squiffy to read documents upside-down for while, but at least you can now get a pretty good estimate of the locations on the document!
I found this description helpful too
Also good old GhostView (gv) shows coordinates.
CanOpener is a very impressive tool for working with PDF files. It operates as a plugin for Acrobat Pro - http://www.windjack.com/product/pdfcanopener/
Another option would be to use the Foxit Phantom PDF Advanced Editor which allows you to select objects and see the properties of each object.
You could use a library such as Quick PDF Library to render the image to a BMP file and then write yourself a little TOOL to scroll and zoom around the BMP file reporting back coordinated. http://www.quickpdflibrary.com - (Note : I do consulting work for Quick PDF)
I am sure you could load the PDF into Adobe Illustrator and get the current coordinates in the status bar.
Andrew
If you are trying to do this without using Acrobat Pro because it not free, here is how you can do it.
1. download and install Acrobat Pro (yes seriously)
2. activate the trial version. if you already did this, it's okay
3. once the trial is done you will lose a bunch of tools from Acrobat, but you will definitely not lose the cursor coordinate tool
here is how to use it
1. go to the main menu strip, click view, and select show/hide
2. from here you can select cursor coordinate and voilà
I use InkScape v 0.91 to map out PDF rectangles for extracting text. It can load a PDF into the canvas. Don't forget to change the measurements to inches (Ctrl-Shift-D) with the document open for the document properties. For the Page property tab set the Default Units to inches, for the Grids property tab set Grid Units to inches.
This page, PDF coordinates, explains the PDF coordinate system, and its unit of measurement.
I was looking for a tool to get the co-ordinates to use extract option available in PDFBox library. Gimp way worked well for my purpose. I opened the PDF in Gimp and set the measuring unit to points.
In case you don't want to install any heavy software for such a trivial task, you can create annotations in a xfdf file, set their location and then see which area is annotated in PDF.
You can use this template:
<xfdf xmlns="http://ns.adobe.com/xfdf/" xml:space="preserve">
<annots>
<square style="solid" width="4" color="#000000" opacity="1" creationdate="D:20190624111403Z" flags="print" date="D:20190624111403Z" page="0" rect="0,0,135,390.6" subject="ROI" title="ROI" />
</annots>
<pdf-info version="2" xmlns="http://www.pdftron.com/pdfinfo" />
</xfdf>
Change the coordinates of the "rect" attribute, save the file as xfdf. Then, as you open the xfdf file in Adobe reader, the reader will ask for the location of the PDF file. Locate the PDF document, and you will see the rectangle drawn at the specified coordinates.
There is ImageMagick which is lighter than Gimp and gives you coordinates along your mouse pointer.
Adobe Reader has it.
Edit->Analysis->Geospatial Location Tool