public bool GetStream(int idx, out CGPDFStream result) { IntPtr ptr; var r = CGPDFArrayGetStream(handle, idx, out ptr); result = r ? new CGPDFStream(ptr) : null; return(r); }
static IntPtr Create(CGPDFStream stream, NSDictionary?streamResources = null, CGPDFContentStream?parent = null) { if (stream is null) { throw new ArgumentNullException(nameof(stream)); } return(CGPDFContentStreamCreateWithStream(stream.Handle, streamResources.GetHandle(), parent.GetHandle())); }
public bool GetStream(string key, out CGPDFStream result) { if (key == null) { throw new ArgumentNullException("key"); } IntPtr ptr; var r = CGPDFDictionaryGetStream(handle, key, out ptr); result = r ? new CGPDFStream(ptr) : null; return(r); }
public CGPDFStream[] GetStreams() { using (CFArray a = new CFArray(CGPDFContentStreamGetStreams(Handle))) { var streams = new CGPDFStream [a.Count]; for (int i = 0; i < a.Count; i++) { streams [i] = new CGPDFStream(a.GetValue(i)); } return(streams); // note: CGPDFStreamRef is weird because it has no retain/release calls unlike other CGPDF* types } }
public CGPDFContentStream(CGPDFStream stream, NSDictionary streamResources = null, CGPDFContentStream parent = null) { if (stream == null) { throw new ArgumentNullException("stream"); } var dh = streamResources == null ? IntPtr.Zero : streamResources.Handle; var ph = parent == null ? IntPtr.Zero : parent.Handle; Handle = CGPDFContentStreamCreateWithStream(stream.Handle, dh, ph); }
public bool TryGetValue(out CGPDFStream value) { IntPtr ip; if (CGPDFObjectGetValue(Handle, CGPDFObjectType.Stream, out ip)) { value = new CGPDFStream(ip); return(true); } else { value = null; return(false); } }
public bool TryPop(out CGPDFStream value) { IntPtr ip; if (CGPDFScannerPopStream(Handle, out ip)) { value = new CGPDFStream(ip); return(true); } else { value = null; return(false); } }
public bool GetStream(int idx, out CGPDFStream result) { return(GetStream((nint)idx, out result)); }
public CGPDFContentStream(CGPDFStream stream, NSDictionary?streamResources = null, CGPDFContentStream?parent = null) : base(Create(stream, streamResources, parent), true) { }