XPS Document Print Tiling - printing

Currently I have an XPS document whose width is too large for the paper. I would like it to print the clipped off contents on additional pages. I have not been successful at finding a setting to accomplish this.
Any ideas for a solution?

You might be able to control this by using a PrintTicket or by working with the PrintQueue. There isn't anything in the XpsDocument (other than the PrintTicket) that controls how the printer deals with this.

Boyd,
I had the same problem with XPS documents created from Visual Studio DGML graphs. The parts of my solution to this I blogged about at http://craigwatson1962.wordpress.com/2010/11/26/convert-an-xps-to-jpeg-png-tiff-or-bmp-in-a4-pages/
This solution will tile the XPS into multiple A3, or A4, pages to a graphics file format, or into multiple pages in a TIFF file.

Related

OKI pdf printing problem - different font and symbols

I have an OKI MC352dn printer.
Printing images and image pdfs works fine and the results are satisfactory.
However when I print certain pdf files, for example some mathematical articles, the font changes, and the output is completely different from the original pdf. Also, some QR-looking codes are also printed as a garbled mess.
Changing a .pdf to a .png fixes the problem, however this is tedious and I'd prefer not to do it.
I noticed that the font used was Courier which is the PCL emulation default font.
I honestly have no idea what that means, and what PCL emulation is, but I found it in the printer admin settings.
Is it possible to change the settings so that the printer always prints the pdf correctly, and doesn't use any of it's default settings?
I have updated the firmware and installed all drivers, but the problem persists, even if sending the print job from a different device.
EDIT:
Here's a preview of the a .pdf file
And here's the printed output

FastReport - display PDF in report

I try to display a PDF file (stored in the DB as image field) in my report. When I display it in an image object, the image object appears empty.
What am I doing wrong or is there another way to display PDFs in a FastReport report?
I'm using Delphi Embarcadero XE6 and FastReport V5.1.
Use TfrxPictureView and assign it with your database field
If you have already converted all PDFs to JPEG and then stored them as JPEGs in the DB, then TfrxOleView will be able to display them.
If not, you need to create a custom report component derived from TfrxReportComponent and handle its Draw event. The Draw event should get the PDF blob, convert it as a metafile/bitmap, and then draw the metafile/bitmap on the canvas of the custom control. This custom component needs to be used in your report instead of the TfrxPictureView control. (Check FastReport's Developer manual for more information.)
You will need a PDF library to convert the PDFs to metafile/bitmap. (I recommend my company's product PDFtoolkit for this.)
PDF-to-JPEG conversion takes time and may slow down your reports. So, I would advise you to first run the conversion on your DB and store the images in another column. That way, you don't have to write any custom report component. You just refer the images column/field.

Rendering PDF in iOS

Need help on rendering PDF using CGPDFContext. I am currently using UIWebView to display PDF but would like to perform much more operation rather than just reading like Highlight Text, Search PDF, Annotate PDF. Not looking for using any Framework or library.
Any help will be beneficial. For a start, code on how to render PDF using CGPDF and displaying it instead of using UIWebView.
PDF annotations are a rabbit hole. I've been working on them since 2010. The spec is thousands of pages. It's easy to get started but it takes forever to get right with all the PDFs and variations out there. Even a simple feature like bookmarks are harder than you would think.
To date there's no open source framework that implements PDF annotations. The above linked one can be a good starting point. If you don't have months/years to build something on your own, there are a few commercial options available - like PSPDFKit, available for iOS, Android and Web, which I am building.
We have a guide article listing the most important PDF spec documents.
Searching is another tricky topic. It's quite hard to convert the PDF text data to unicode. The Adobe CIDFont spec is a good starting point.
You shoud try VFReader, it is an open source project for rendering PDF files on iOS. It can be a good starting point.

PDF Previewing and viewing

I'm creating a document viewing web application. You log in and it takes you to a screen where you have all your docs listed on the left. I want to make it so that when you roll over a document a preview of the document shows up on the right. From there you can click on it for a full view and printing capabilities. I'm not asking how to do all that but I'm wondering what the best way would be to go about rendering the preview of the document. The documents are all going to be pdfs and stored on a server. I'm working in asp.net 3.5 mvc in visual studios 2008.
For creating the PDF preview, first have a look at some other discussions on the subject on StackOverflow:
How can I take preview of documents?
Get a preview jpeg of a pdf on windows?
If these don't answer your question, you can try a couple more things:
You can get a commercial renderer (PDFViewForNet, PDFRasterizer.NET, ABCPDF, ActivePDF, ...).
Most are fairly expensive though, especially if all you care about is making thumbnails.
There is a CodeProject article that shows how to use the Adobe ActiveX, but it may be out of date, easily broken by new releases and its legality is murky.
Install GhostScript on the server and request rendered thumbnails of any page from it.
I did a small project that you will find on the Developer Express forums as an attachment.
Be careful of the license requirements for GhostScript through.
I use it for an internal software and it's working pretty well.
Hope this helps.
Here
I render the jpeg thumbnails of the first page of the pdf document when a file is uploaded.
When the user clicks he can download the document (or open them direcly in the browser) to read and print them.
Update: to create the thumbnails I used a .net component called PDFView4NET from O2Solutions

Search Words in pdf files

Is it possible to search "words" in pdf files with delphi?
I have code with which I can search in many others files like (exe, dll, txt) but it doesn't work with pdf files.
It depends on the structure of the specific PDF.
If the pdf is made of images (scanned pages) then you have to OCR each image and build a full text index inside the PDF. (To see if its image based, open it with notepad and look for obj tags full of random chars). There are a few utilities and apps that do this kind of work for you, CVision PDF Compressor is one that I have used before.
If the pdf is a standard PDF, then you should be able to open it like any other text file and search for the words.
Here is page that will detail some of the structure of a PDF. This a SO post for the same.
The components/libraries mentioned in the answer to this question should do what you need.
I'm just working on a project that does this. The method I use is to convert the PDF file to plain text (with pdftotext.exe) and create an index on the resulting text. We do the same with word and other office files, works pretty good!
Searching directly into pdf files from Delphi (without external app) is more difficult I think. If you find anything, please update here as I would also be very interested in that!
One option I have used is to use Microsoft's ifilter technology, this is used by windows desktop search and many other products such as sharepoint and SQL server full-text search.
It supports almost any office/office-like file format, even dwg, msg, pdf, and files in zip/rar archives.
The easiest way to use it is to run FiltDump.exe on any files you have, and index the text output.
To know about the filters installed on your PC, you can use ifilter explorer.
Wikipedia has some links on its ifilters page.
Quick PDF Library's GetPageText function can give you the words from a PDF as well as the page number and the co-ordinates of those words - sometimes useful for highlighting.
PDF is not just a binary representation. Think of it as a tree of objects, where an object node has some metadata and some content information. Some of these objects have string data, some don't. Some of these are even encrypted, and some are compressed. So, there's very little chance your string finder will work on any arbitrary PDF.

Resources