Cocoa pdf page object for search and copy/paste? - ios

I know that a method for rendering pdf pages into images is available natively in quartz.
Now I need to know if there is an object-oriented way to have pdf pages in my application (OSX and iOS) which are "live", that is copy/paste is possible and search too.
In other words, is available in some way a ready-made object to put into a view? I mean natively, without commercial libraries, but for commercial application.

Apple’s PDF Kit, introduced with Mac OS X version 10.4, lets you add PDF viewing and navigation to your Mac OS X application with just a few clicks in Interface Builder.
With PDF Kit, your application can access much of the functionality described in the Adobe PDF specification with just a small number of Cocoa classes. The Preview application in Mac OS X 10.4 and later uses PDF Kit for PDF support, so you can use that application as an example of some of PDF Kit’s features.
If you want to go beyond simple PDF viewing, PDF Kit includes a suite of Objective-C utility classes. These utility classes provide lower-level support of PDF features, allowing more control over annotations, selections, and so on.

Related

FastReport VCL Azure Web App images black box

We are migrating our Delpi IntraWeb app from an on-premises installation to an Azure Web App. Our app uses FastReport VCL 5 to export PDF files. This works fine on-premises, but when we do the same thing on Azure Web App, all the images in the PDF are black boxes.
Does anyone have experience with this behavior and can offer help?
Example of the visible image in the FastReport editor
Example of the PDF with black box instead of image
FastReport support have told us they can't solve the issue because Azure Web Apps limit access to certain OS functions, such as the Registry and Graphics. You can read more about it here: https://github.com/projectkudu/kudu/wiki/Azure-Web-App-sandbox
The solution for us was to use FastReport to generate the PDF without the images, and Gnostice PDF Toolkit to add images to the generated PDF file after. PDF Toolkit manages to make real images instead of black boxes. This is a bit of a hacky solution, but it allowed us to rewrite much less code.

Is it possible to install a J2ME application on a mobile that does not support the language mobile requires (like persian language)?

Situation: I want to get a very simple J2ME mobile application developed that uses Persian language displaying the label and text, and this is to be installed on any mobile that runs J2ME (like nokia 1280).
Question: Is it possible to use Persian fonts and embed it in such a way that it is independent of mobile device (i.e. does not care if mobile has Persian language installed) or do we need to use png images as labels?
Standard MIDP2.1 and CLDC 1.1 doesn't have classes to let you use TTF fonts. The typical way of doing it, is to use a bitmap font. Bitmap fonts are fast to render, and lets you use a lot of colours (if you wish). The downside of bitmap fonts is that, in order to support multiple screen resolutions, you'll have create different sizes of the font.
http://mobilefonts.sourceforge.net/
But like any other platform, someone has of course developed a TTF library for JavaME (called TTME)
http://www.xiteapplet.de/
I remember checking out TTME some time back, and as expected TTF rendering is slow. (Because most JavaME enabled devices have lower-end CPU's and such).
My advice is to go for bitmap fonts or use individual PNG files for labels.

Any good PDF export filter that works with Fast Report?

I recently discovered that the PDFs exported by the Fast Report's PDF export filter aren't displayed correctly in Mac OSX, iOS and Android devices.
Fast Report informed that their pdf implementation only support Windows and they can't say when the new implementation that they are working on will be available.
I also tried to use the Gnostice export filter, but their demo installer didn't work in Delphi XE and when I contacted them, they took 15 days to send me some attached dcus which also didn't work. So I'm searching for another option.
If you know or use a PDF export filter which works with Fast Report, please let me know.
November 2015: Fast Report now have PDF/A support, with this option enabled the PDFs are fine on all platforms.
October 2014 - Fast Report 5 still seems to generate "Windows-only" PDF. A production-ready solution for this problem would be a benefit for cross-platform developers, given that Fast Report is the report generator bundled with Delphi.
Here is a fresh example generated with the Fast Report 5 demo, displayed with Adobe Reader 11 on Android 4.4:
And on Windows:
Fast Report informed that their pdf implementation only support Windows and they can't say when the new implementation that they are working on will be available.
I'm not sure that should be taken literally, considering PDF is supposed to be a cross platform format. It more likely means they don't actually have the time, equipment or expertise to test with those platforms. The PDF export filter that I'm using is the one built into Fast Report! It surely has some bugs, but I managed to work around them. And I think that might also work for you: Start with a simple document that does export properly, start adding features until it brakes, then you know what brakes it and you'll know how to work around the problem.
From my experience, here's what got me into trouble:
Rounded corners in the PDF document didn't look like the ones in the Fast Report preview. My fix: Found a combination of settings that made the exported PDF look exactly like the preview document. For me rounded corners were just a cosmetic feature, and with cosmetics there's no "One Look"; The alternative worked just fine. This might actually be fixed in the most recent version, but I didn't bother changing the document to test.
Transparency issues and outline issues. When working with the Fast Report editor (and when looking at it's previews) it's easy to overlap objects. You don't see this because of the object opacity. When exporting to PDF overlapped objects somehow managed to "print" outlines, and it obviously looked ugly. My fix: pay closer attention to those objects, make sure they don't overlap or make sure they don't generate outlines if no outlines are supposed to be seen.
Also make sure you test using ADOBE Reader, on any of the given platforms. If it works with the Adobe reader but doesn't work with other readers, there might be a bug in the 3rd party reader!
Edit: Here (link) is a sample PDF document generated by my Fast Reports application. I have no idea what kinds of documents you generate, but in my book that's a mighty complex document. Notice the diagonal line that starts where the table data ends, notice the embedded images (bar code, stamp, signature).
I opened that document on the following mobile devices:
iPad, running iOS: The document renders 90% ok. Images are not rendered at all, but they're not important to my document (and that's very likely a problem with the iOS reader). All the fancy colored lines and rounded corners are properly rendered. Some text is not properly rendered, and I'm pretty sure that didn't render because the "box" that contains it is too small for the contents. That most likely happens because I didn't embed the TTF fonts into the PDF and the Apple font on iOS didn't perfectly match the Microsoft font that was used on Windows.
Samsung Galaxy S2, running Android 2.3: The document renders 100% correctly.
Samsung Something(??), running Windows Mobile 6.5 and the FoxReader: The document is totally gibberish: pictures showed up but the spacing between letters was messed so bad it's impossible to read. I blame the reader, it's not Acrobat and it probably wanted to be "smart". And it broke it's teeth in my text encoding, because my text is not English.
About the PDF format: A document is "PDF" if it conforms to the standard, here's some Wikipedia info on that. In theory a PDF document should render exactly the same way any way you look at it, but there are forces at play that might work against this:
Not all readers are "Adobe Acrobat". In theory they're all compatible, in practice they're most like not 100% compatible.
PDFs that don't embed fonts depend on the fonts available on the host system. If they're not the exact same fonts there's trouble ahead, because they might have slightly differing sizes. Since we're talking about PDF's that were generated on Windows and opened on iOS or Android, those are obviously different platforms and they're guaranteed to use different fonts (because fonts are licensed, and I doubt Microsoft will licence it's fonts to Apple. I also doubt Apple would want Microsoft fonts). One possible solution is embedding fonts, but that makes your PDF files significantly larger.
AFAIK you can export your Fast Report pages as metafiles (i.e. vectorial Windows format, which is in fact a raw serialization of GDI commands).
Then you could be able to render those metafiles into PDF using our Open Source SynPDF library. It works from Delphi 5 up to XE, is Unicode ready, can embed true type fonts, and even create PDF/A files.
It is also able to export metafiles included in reports as vectorial pictures (and not bitmaps), and could therefore highly increase the pdf quality and at the same time shrink its size.
See for instance how it can be used for QuickReport. A similar technical should be used with Fast Report.
The Gnostice support answered my e-mail which I reported that their trial installer didn't work and send me some tips about which could be the problem and I was able to install it.
The company I work for already bought me a license and I already replaced the Fast Report Export Filter, which was a task as simple as droping 2 components on the same Form as the frxReport Object and setting 2 or 3 properties.
Also, to export the report programatically was also 2 lines of code and the information was easily found in their FAQ.
In the end, based on the recomendations and after looking for other options just to find abandoned components which doesn't have any updates for years, the Gnostice eDocEngine was the best solution.
Just hope they make their installer a little more "Programmer Friendly" as if it had complained about the lack of Fast Report's units in the search path I would've been able to at least have an idea of what was going on, instead of just getting an error and blaming them for having a trial installer which didn't work.
After replacing the filter and generating the PDF's using the eDocEngine component, the PDFs now work the same in iOS, OSX and Android.
Here is my workaround solution. It's not an universal one, but helped me in my case.
The main idea: use in report font with small file size (I've found Arial-like font with cyrillic charset with size 57kb). So the exported files can be 100-200 kb.
Details is here:
http://dev-doc.blogspot.com/2013/03/fastreport-4-font-reading-and-huge-file.html
I use wPDF from WPcubed components, it's really a great product, good value for money
You can always install one of the PDF printers. These are in fact PDF convertors that install as windows printer. They work from any application including FastReprt components - just print on them.

is adobe acrobat sdk library useful to render pdf's in custom application?

I would like to ask if the acrobat sdk allows me to create an application that is able to render a pdf document from inside my application, that is, without the user having to open the adobe application along, but just having to have it installed on the system. thanks
No, the Acrobat SDK is for use with Acrobat, as its name implies. What you need is the Adobe PDF Library (APDFL), which is sold and supported by Datalogics. There are also a number of other third party PDF SDKs, some of which are quite good and almost all are far less expensive. If you haven't already made a decision, I highly recommend you investigate them.
Yes
From What is the Acrobat Software Developer Kit? | Adobe Developer Connection:
You can also use IAC support to render a PDF file into an external application window instead of the Acrobat window.
So, you can render a PDF using the Acrobat SDK in a custom application without the user needing to open Acrobat but it does need to be installed on the system running the custom application.
Alternatives
The Adobe PDF Library is an alternative means of rendering PDFs in a custom application and with it you could do so without needing to install Acrobat on the computer running the custom application. But it's expensive, e.g. thousands of dollars (per year?). And it's print output doesn't exactly match Acrobat [emphasis mine]:
Improved print output to bring it closer to Acrobat
There are also many many other PDF libraries with which you could render a PDF in a custom application.

Create a thumbnail of a dwg in in a linux environment

Creating a ruby on rails site that uses RMagick to create thumbnails for many types of images. RMagick cannot read dwg files however.
I've tried a few things, looked into the Java library JDWGLib, which would probably allow me to write a converter, but it would be a total from the ground up solution, where I just need a thumbnail.
Also considered using a viewer program to open the file in a remote X session and do a screen capture, however I'm not sure how I could ever guarantee that the viewer had completed opening when I took the screenshot.
I'm not concerned with being able to manipulate the file other than to create the thumbnail. It is going to be used for commercial purposes, so any libraries used need to be compatible.
cad2svg is a simple Linux command-line utility that automatically converts AutoCAD files (both dwg and dxf) to SVG.
the link
I could not find any command-line-able tool for making thumbnails, on either windows or linux.
I guess you could download the DWGdirect lib (C++) wich allows the exportation of a DWG to a bitmap... but this requires purchasing a membership license on the """Open""" Design Aliance.
I would recommend adding an additional file input on your form that says "thumbnail". And let the users provide the screenshots.

Resources