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);
        }
Exemple #2
0
        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 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);
        }
Exemple #5
0
        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);
        }
Exemple #6
0
        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);
            }
        }
Exemple #7
0
        public bool TryPop(out CGPDFStream value)
        {
            IntPtr ip;

            if (CGPDFScannerPopStream(Handle, out ip))
            {
                value = new CGPDFStream(ip);
                return(true);
            }
            else
            {
                value = null;
                return(false);
            }
        }
Exemple #8
0
		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;
		}
Exemple #9
0
 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;
     }
 }
Exemple #10
0
 public bool TryPop(out CGPDFStream value)
 {
     IntPtr ip;
     if (CGPDFScannerPopStream (Handle, out ip)) {
         value = new CGPDFStream (ip);
         return true;
     } else {
         value = null;
         return false;
     }
 }
Exemple #11
0
 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
     }
 }
Exemple #12
0
 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;
 }