How can I get more detail in pdf file that created by core plot? - core-plot

I use core plot to create ECG graph. I can see the detail in the ECG graph in my app, but I can't see the detail in the pdf file.
How can I get more detail in pdf file that like app screenshot?
Thanks, Midas

The image is exported at the same size as the layer. Set the size of the layer bounds to a larger size before calling -dataForPDFRepresentationOfLayer or -imageOfLayer.

Related

C# Newbie - Vector Printing of Visio Document using AxVisioViewer ActiveX control

I am using VS2013Express to create a windows form based application which will display and eventually print Visio documents, rather than relying on the browser based Visio Viewer. Needless to say this is a very specific requirement, so really don't need anyone telling me to use the MS Visio Viewer!
So far, I can open the Visio document, display it using the AxVisioViewer.dll control. I can even print... to a degree.
The issue is that I can only print currently using a PrintFromScreen method which basically captures the image of the form as displayed on screen and creates a Raster BitMap of it.
I copy the BitMap image to a hidden panel on the form (to remove toolbars etc), then print the contents of the panel. Simple (ish)!
Here's a link to the page I used to create the panel and print the image.
What I want to be able to do is resize (Vector not Raster to retain scale) and centre the image as required to ensure the document prints properly.
You'll want to center the drawing in the control.
Check the following link.
https://msdn.microsoft.com/en-us/vba/visio-vba/articles/viewer-zoomtorect-method-visio-viewer
You may also check the zoom and pan methods.

Export text and image in the same file

What I want to do is exporting some data from my app to a text file - say an RTF file. I found that converting text can be done through this classes, but is there a way to save an image also?
If you want to export text + images in the same document you can do it usig Core Graphics. Please search for CGPDFDocument Reference and Quartz 2D Programming Guide in Apple documentation.
However in order to do this you need to have an understanding of the PDF format and you should read the Adobe guide PDF Reference, Fourth Edition, Version 1.5
Using CGPDFContext you can create a UIView, draw your contents into it (using sub views to make life easy for text and images) and then render the views layer into the PDF context. Then save the resulting data to a file.

Best way to store and load Freehand Drawing Lines for every image

I found this post Draw Lines Load From Plist in iphone sdk about saving and loading your Freehand Drawing from plist.
In my app I am able to draw on a captured photo and save it as a new image in my photo library. But I want to just save the photo without the drawing to my photo library and be able to load my Freehand Drawing Lines manually whenever I load the original photo.
In the above named link he saves his linecoordinates in a plist. Is it effective to create for every photo a new plist?? Any ideas? Please help :(
I would really appreciate any ideas you might have! Thank you
The reason he uses line coordinates is because the mobile devices receive the data the same way (relative to previous or absolute). So unless the size of the line coordinates is bigger than a compressed pixel array (png, jpg, etc), this is the best way. For simplicity though, I would just keep that format.
If size is a problem for you, just use zlib (http://www.zlib.net/) to compress/uncompress the data - it's available on all mobile devices.
You could also use different algorithms to reduce the size of the data prior to zlib compression - for instance, if all coordinates are relative to the previous one, the values would be smaller meaning you could encode it in a smaller type of data - integer to byte for instance - or a dynamic one (ie: 1 byte + 0 if done 1 if another byte) + ....).

Generating an image using Cocoa

My iOS app needs to be able to generate an image to post to Facebook and Twitter. The image will be a representation of data added by the user. The image is not a direct representation of any view that will be displayed on screen. It is not necessary to include any other image resources in the image created - for the most part I need to format the style and layout some text, and maybe add some borders, lines, etc - but I would like the ability to add this later if it is simple.
What approach is best for something like this? Should I build a UIView and output it to a file somehow? Is there an HTML/CSS solution? Or some other approach?
Bonus points if you can recommend the file format and attributes optimized for posting to Facebook/Twitter.
Use UIGraphicsBeginImageContextWithOptions() to create a new image context.
Then, draw whatever you like into it using Core Graphics. You can draw text using Core Graphics or Core Text — the former is easier, but the latter gives you more opportunity for customisation.
Then, get a UIImage out of your context by using UIGraphicsGetImageFromCurrentImageContext().
You can then convert the UIImage into a PNG using UIImagePNGRepresentation().

What is the easiest way to create complex PDF in iOS?

I am trying to generate some complex invoice data in PDF format. I know two Technique:-
By converting Data into HTML data via UIWebView and generate its PDF accordingly. But it is having issue of showing data Blur or unreadable if Zoom, when data is long in size. Cause it actually first create Image from HTML data and generate pdf.
Using QuartzCore technique mentioned in Ray-Wenderlich tutorial:-
http://www.raywenderlich.com/6818/how-to-create-a-pdf-with-quartz-2d-in-ios-5-tutorial-part-2
Is there any way other then these above two? Also is it possible in the First technique to get data in UIWebView as vector based so that when it zoom it will not blur the data?
Thanks in Advance,
Vivek
Use the Quartz 2D framework as described in the tutorial. You don't want to create a pixel image from the html because it does not scale and can get large.
You can use a tableview with multi sections to create your invoice and convert it to an image(uiview----> image) and After that print that image to pdf (image--->pdf).

Resources