예제 #1
0
 private byte[] DeflateStream()
 {
     if (gDeflatedStream == null && gStream != null)
     {
         if (gValue.isObject() && gValue["Filter"] != null && gValue["Filter"].value.valueName == "FlateDecode")
         {
             gDeflatedStream = PdfReader.FlateDecode(gStream);
         }
         else
         {
             gDeflatedStream = gStream;
         }
     }
     return(gDeflatedStream);
 }
예제 #2
0
파일: PdfWriter.cs 프로젝트: 24/source_04
 public void WriteChildsObject(IPdfValue value)
 {
     if (value.isObjectRef())
     {
         WriteObjectWithChilds(gpr.ReadObject(value.valueObjectId));
     }
     else if (value.isObject())
     {
         foreach (PdfNValue nvalue in value.objectValues.Values)
         {
             WriteChildsObject(nvalue.value);
         }
     }
     else if (value.isArray())
     {
         foreach (IPdfValue value2 in value.arrayValues)
         {
             WriteChildsObject(value2);
         }
     }
 }
예제 #3
0
파일: PdfWriter.cs 프로젝트: 24/source_04
 private void WriteValue(IPdfValue value)
 {
     if (value.isNull())
     {
         // /OpenAction [3 0 R /FitH null]
         gw.Write("null");
     }
     else if (value.isBool())
     {
         // /OP true /Type /ExtGState
         gw.Write(value.valueBool ? "true" : "false");
     }
     else if (value.isInt())
     {
         // /MediaBox [0 0 907.09 1292.59]
         gw.Write(value.valueInt.ToString());
     }
     else if (value.isDouble())
     {
         // /MediaBox [0 0 907.09 1292.59]
         gw.Write(value.valueDouble.ToString("0.00"));
     }
     else if (value.isName())
     {
         // /PageLayout /OneColumn
         gw.Write("/{0}", value.valueName);
     }
     else if (value.isString())
     {
         // /Producer (FPDF 1.6)
         gw.Write("({0})", value.valueString);
     }
     else if (value.isDateTime())
     {
         // /CreationDate (D:20121205105056)
         gw.Write("(D:{0:yyyyMMddHHmmss})", value.valueDateTime);
     }
     else if (value.isObjectRef())
     {
         // /Pages 1 0 R
         gw.Write("{0} {1} R", value.valueObjectId, value.valueObjectGenerationNumber);
     }
     else if (value.isObject())
     {
         // <<
         // /Type /Page
         // /Parent 1 0 R
         // /MediaBox [0 0 907.09 1292.59]
         // /Resources 2 0 R
         // /Contents 4 0 R
         // >>
         gw.Write("<<\n");
         foreach (PdfNValue nvalue in value.objectValues.Values)
         {
             gw.Write("/{0} ", nvalue.name);
             WriteValue(nvalue.value);
             gw.Write("\n");
         }
         gw.Write(">>");
     }
     else if (value.isArray())
     {
         // /OpenAction [3 0 R /FitH null]
         gw.Write("[");
         bool first = true;
         foreach (IPdfValue value2 in value.arrayValues)
         {
             if (!first)
             {
                 gw.Write(" ");
             }
             WriteValue(value2);
             first = false;
         }
         gw.Write("]");
     }
 }
예제 #4
0
파일: PdfWriter.cs 프로젝트: labeuze/source
 private void WriteValue(IPdfValue value)
 {
     if (value.isNull())
     {
         // /OpenAction [3 0 R /FitH null]
         gw.Write("null");
     }
     else if (value.isBool())
     {
         // /OP true /Type /ExtGState
         gw.Write(value.valueBool ? "true" : "false");
     }
     else if (value.isInt())
     {
         // /MediaBox [0 0 907.09 1292.59]
         gw.Write(value.valueInt.ToString());
     }
     else if (value.isDouble())
     {
         // /MediaBox [0 0 907.09 1292.59]
         gw.Write(value.valueDouble.ToString("0.00"));
     }
     else if (value.isName())
     {
         // /PageLayout /OneColumn
         gw.Write("/{0}", value.valueName);
     }
     else if (value.isString())
     {
         // /Producer (FPDF 1.6)
         gw.Write("({0})", value.valueString);
     }
     else if (value.isDateTime())
     {
         // /CreationDate (D:20121205105056)
         gw.Write("(D:{0:yyyyMMddHHmmss})", value.valueDateTime);
     }
     else if (value.isObjectRef())
     {
         // /Pages 1 0 R
         gw.Write("{0} {1} R", value.valueObjectId, value.valueObjectGenerationNumber);
     }
     else if (value.isObject())
     {
         // <<
         // /Type /Page
         // /Parent 1 0 R
         // /MediaBox [0 0 907.09 1292.59]
         // /Resources 2 0 R
         // /Contents 4 0 R
         // >>
         gw.Write("<<\n");
         foreach (PdfNValue nvalue in value.objectValues.Values)
         {
             gw.Write("/{0} ", nvalue.name);
             WriteValue(nvalue.value);
             gw.Write("\n");
         }
         gw.Write(">>");
     }
     else if (value.isArray())
     {
         // /OpenAction [3 0 R /FitH null]
         gw.Write("[");
         bool first = true;
         foreach (IPdfValue value2 in value.arrayValues)
         {
             if (!first)
                 gw.Write(" ");
             WriteValue(value2);
             first = false;
         }
         gw.Write("]");
     }
 }
예제 #5
0
파일: PdfWriter.cs 프로젝트: labeuze/source
 public void WriteChildsObject(IPdfValue value)
 {
     if (value.isObjectRef())
     {
         WriteObjectWithChilds(gpr.ReadObject(value.valueObjectId));
     }
     else if (value.isObject())
     {
         foreach (PdfNValue nvalue in value.objectValues.Values)
         {
             WriteChildsObject(nvalue.value);
         }
     }
     else if (value.isArray())
     {
         foreach (IPdfValue value2 in value.arrayValues)
         {
             WriteChildsObject(value2);
         }
     }
 }