QuickPDF converting a PDF to an Image: letters move in eachother - delphi

Quick PDF has a feature to convert a PDF into an Image:
iNumPages := PDFLibrary.PageCount();
PDFLibrary.RenderDocumentToFile(300, 0, iNumPages, 0, 'H:\temp\quickpdf_testimage_6_new.bmp');
If this feature is executed the letters move (with some PDF sources) in each other. In the following there is a PDF and the resulting JPG:
PDF: http://www.baunetz.de/aip/2001/tunnel.pdf
Now there is a problem: in the resulting Image the Letters move in eachother.
Update:
I have cause of the Problem:
"
This PDF contains a font (OfficinaSans-Book) that is not embedded in the PDF so Quick PDF substitutes Arial instead which has thicker characters.
This is a common problem with PDF's and many PDF viewers. The best solution is to create the PDF with embedded fonts for any of the non standard fonts that are used in the PDF."
http://www.quickpdf.org/forum/topic2478_post10369.html#10369
Update 2:
The only PDF Engine so far that has no Problems with 'lettes moving in each other' is the foxit DLL.

I have cause of the Problem: " This PDF contains a font (OfficinaSans-Book) that is not embedded in the PDF so Quick PDF substitutes Arial instead which has thicker characters.
This is a common problem with PDF's and many PDF viewers. The best solution is to create the PDF with embedded fonts for any of the non standard fonts that are used in the PDF." http://www.quickpdf.org/forum/topic2478_post10369.html#10369
Edit:
A possible solution would be to use MultiMaster fonts if the font wasn't found on the system. Adobe uses this technique. But i haven't found a way to implement that with quickpdf.

Related

How to print with custom page in ruby on rails?

Can i print a lot of same barcode image (depends on total barcode) in rails?
Example total_barcode is 6, so i print 6 same barcode.
The image will fit with the layout.
If the size of paper only fit 4 image, and it will generate another page until there are 6 image
Its looks like
XX(page 1)
XX(page 1)
XX(page 2) the x is image
Thanks i hope you guys can understand what i'm trying to say 😭
This is possible.
I would suggest first creating the barcodes page as html, and then converting to pdf.
To create the barcodes on an html page, you have to use a barcode font (Google it), you will need to load the fonts into the page, and specify the barcode font for the barcode "text" in css. When you render text with a barcode font, it appears on the page as a barcode.
Next you need to convert the html to pdf. I suggest using the same url, but appending .pdf to the url instead of .html. You can look for libraries that convert from html to pdf.
Sorry I haven't provided much detail, this is a big project!

Is it possible to generate a PDF that is recognized as x1a?

We know that the x1a standard requires images without transparency, fonts converted to outline, and cmyk colors, but not every pdf with these specifications is recognized as x1a.
Is there any way for us to export/save using the x1a presets that is recognized like this in prepress software?

Using Jupyter notebook with LaTex. Images not exported to pdf via LaTex

New to Juypter, trying to use it with Latex. Everything works fine except for the images. I used this tutorial: https://www.youtube.com/watch?v=m3o1KXA1Rjk&t=149s
Png Images are fine in markdown, i.e
But LaTex cannot determine size of png images. If I save the image as pdf I get the same issue. If I save the image as eps then LaTex complains that it cannot convert eps to pdf.
Has anyone had this issue? Anyone know how to solve it?
PNG images always contain the size in pixels.
Optionally, they can include a chunk of data named pHYs. This contains the resolution of the image. If this chuck is present, you should be able to find the actual text pHYs in the file.
If this chunk is missing from the PNG file, the scale of the image can not be found.
If you are on a UNIX-like operating system you could use grep or hexdump to check for the text pHYs in the PNG file. The identify program from the ImageMagick suite also can display the resolution of PNG images.
Note that there is an error in the video. The author first uses latex and then pdflatex three times. That is not a good idea, since they have different capabilities w.r.t. graphics. Stick with pdflatex.

CGContextDrawPDFPage renders white page for valid PDF

I have an issue with PDF rendering using the CGContextDrawPDFPage function. I develop an iPad app (targeting iOS 7) that does very specific things with PDF, and I cannot use UIWebView so please don't suggest it. One of our customers reports a white page being rendered while every other PDF viewer renders the PDF just fine.
To make sure I don't have any dumb errors in my own code, I have taken Apple's ZoomingPDFViewer (https://developer.apple.com/library/ios/samplecode/ZoomingPDFViewer/Introduction/Intro.html), replaced the PDF they ship with the one from our customer, and started it: indeed a white page is being rendered in stead of the proper contents (a scan from a building blueprint.)
I am 100% certain is the not the loading, viewing or rendering code in the ZoomingPDFViewer example from Apple, because every other PDF file I try to view with the example renders just fine!
I'm trying to obtain permission to upload the PDF here, but I don't have it yet, so my question is: without access to the PDF that's being rendered wrongly, has anyone any idea on what this might be? Are there any limits in the PDF renderer that might cause a white page to be rendered?
Thanks in advance!
edit: The PDF is rendered perfectly in every other PDF viewer, including but not limited to the iPad email application (!), Safari on Mac OS X, Preview on Mac OS X, Acrobat Reader on Windows, FoxIt reader on Windows.
edit: converting the original PDF file (which was a pdf 1.3) to a pdf 1.5 using ghostscript on Linux solved the issue: the PDF is now properly displayed! I used the following commandline:
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.5 -dNOPAUSE -dQUIET -dBATCH -sOutputFile="filename.pdf" "filename.pdf"
The iOS pdf rendering engine does not support JPEG2000 images. If your scanned image is such an image then it will not be displayed.

Inkscape + pdftex?

I have a small drawing in Inkscape and I want to embed it in a LaTeX document which I compile using pdftex. pdftex seem to have an oddity of not accepting .eps. infact if what I understood is correct the only vector graphics format it accepts is pdf. When I save my drawing in Inkscape as pdf then what I get is a pdf with a full page with my drawing in the upper corner.
Is there a way to import an Inkscape drawing to pdftex and ignoring this page size? Or do I need to start fiddling with the page settings to make the page size exactly fit the size of my drawing?
So it turns out that Inkscape has a button on the Document properties titled "Fit page to selection" which makes this easier. Oh well.
Yes, pdftex does not accept eps.
I have used inkscape to make figures that I incorporate into .tex documents that I then process with pdflatex. And yes, I set the page size in inkscape so that the figure fits.
You could also try to export to .eps from inkscape, then convert to pdf with the "epstopdf" tool.
Are you giving the optional scaling parameters to \includegraphics? PDF handles bounding boxes differently from encapsulated postscript, and auto-sizing does not seem to work as well.
As far as I know, you have to adjust the bounding box resp. paper size in your PDF. There are tools like eps2pdf to convert EPS to PDF with the same bounding box.
You can even fully automate the process of converting your svgs into pdfs, since inkscape can be called from command line. For instance, the following makefile code does the job (copping and converting) for me:
# svg -> pdf
$(GRAPHIC_DIR)/%.pdf: $(GRAPHIC_DIR)/%.svg
cp $(GRAPHIC_DIR)/$*.svg $(GRAPHIC_DIR)/$*-crop.svg
inkscape --verb=FitCanvasToSelectionOrDrawing --verb=FileSave --verb=FileClose $(GRAPHIC_DIR)/$*-crop.svg
inkscape -A $(GRAPHIC_DIR)/$*.pdf $(GRAPHIC_DIR)/$*-crop.svg
rm $(GRAPHIC_DIR)/$*-crop.svg
Moreover, cropping pdf files can be also done using pdfcrop.

Resources