I'd like to create an infinite PDF Context in Objective-C in an Mac OS x app and crop it afterwards before saving, once I know the size of the production. It is easy to create an infinite PDFContext with CGPDFContextCreateWithURL, but it is impossible to display afterwards with Preview.
Crop PDFContext in Objective C
128 Views Asked by user5036037 At
1
There are 1 best solutions below
Related Questions in OBJECTIVE-C
- How to control the volume of an iPhone programmatically in objective-c
- Occasional crash at NSURLSessionDataTask dataTaskWithRequest:completionHandler:
- How to set value the descriptor of iOS BLE in Objective-C?
- Unexpected #selector() Behavior in Swift-Objective-C Interop?
- In what context can we use an unqualified #selector() expression in Swift?
- AVPictureInPictureController crashes during initialization
- How to use pow() in Objective-C?
- How to change the image on the MGSwipeButton in MGSwipeTableCell
- Using sort descriptors in Outline View
- Why is my Swift function not printing from inside the dataTask closure?
- Using UICollectionViewCell with IBOutlet
- Undefined symbol: _OBJC_CLASS_$_ only on simulator
- Why can't I receive a notification sent from Camera Extension(Swift) to an observer application (obj-c++)
- Behavior of __block modifier in objc
- Inserting subview into view where I've added subviews and sublayers
Related Questions in COCOA
- In what context can we use an unqualified #selector() expression in Swift?
- How can I trigger macOS system gamepad API based on a value received from iOS app through core bluetooth
- Using sort descriptors in Outline View
- NSTableView to NSOutlineView Drag & Drop not accepting drop
- How to remove horizontal line in bottom of section NSTableView?
- CGSRegionRef: How is an arbitrary region represented as union of rects?
- Listen for Touch Events on MacOS (Trackpad)
- Window "yanks" when moving
- Writing NSFilePromiseProviders to pasteboard blocks app on quit
- Basic ImGui program doesn't render, leaks memory and crashes
- NSTokenField suggestion using context menu in swift
- How to link multiple text views to a single text storage in TextKit 2
- I would like to know why I’m not getting IBOutlets connected in an App’s window
- How to make a custom event loop in Cocoa?
- Why is restoreWindow(withIdentifier:state:) called after applicationDidFinishLaunching(_:)?
Related Questions in PDF
- How to use custom font during html to pdf conversion?
- How to get content of BLOCK types LAYOUT_TITLE, LAYOUT_SECTION_HEADER and LAYOUT_xx in Textract
- PDF form checkbox/radio button ignores content stream
- Suggest python library for rendering html to pdf files
- Problems with the order in which PDF files are created
- Centering a map element on a generated PDF
- download all pdf files from website doesn't support wildcard
- How to enter external pdf into quarto book while keeping page layout+numbering
- How do I create a website that combines user input and standard text and converts it into a pdf?
- Excel VBA error 1004 on PDF export - not a path issue
- downloading pdf using requests not working
- Creating pdf on Firestore with Pdfplum: Template path "no such object"
- Export password protected PDF from QGIS
- XPS convert PDF with Ghostscript
- Download PDF in ASP.NET MVC application
Related Questions in CROP
- How to crop a BMP image in half using C
- Cropping image to specific ratio
- need help in error of crop image in python
- How can I programmatically erase PDF margins using Kofax Power Advanced and VBA/VB?
- Having issues parsing cropdetect values from ffmpeg in batch script
- How to draw part of image in Maui.Graphics
- Save scanned MCQ question as separate image using python
- Why does Batik provide incorrect SVG bounds?
- Crop the polygon image with red border
- How to copy masked part from one image into another image using Opencv in python?
- format and crop with ghostscript
- How to auto cropping the image from 100% to 0% without resizing itself
- crop effect in VSTO addin like crop to fill
- how to crop and straight an EL image of solar panel in Matlab
- Crop vector if it is within raster; check multiple large rasters
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
In Similar situations I solved similar problems with another approach.
In a first step I computed some (custom) meta file in which I just noticed which graphical elements along with its properties and coordinates (endless world coordinates, not related to any output device or format) the graphic would have. By doing so I took hold of the maximum x and y coodrinates ever used.
I did not do that on iOS but if I would, then I would certainly use some core data or just a plain sqlite table for that.
Next step would be to break down the meta coordinates into resonable tile of which each correlates to something like a pdf page in your case. These tiles would consider the x/y ratio of the target paper format, landscape or portrait ect. You may want the user to choose and provide a preview page.
Then I'd finally render the pdfs page by page. When you ignore all graphical objects that are completely out of bounds of the current page, then the rendering should be quite fast. Some smart sorting of the meta items by the x and then the y of the top left coordinate of each object, you can improve the performance even more.
I guess you will be surprised how fast this can work, when you do it right.