public PdfContent(PdfAnchor pa) : base(pa) { CanCompress = pa.CanCompress; content = null; // contentStream="%stream\r"; contentStream = ""; }
public PdfContent(PdfAnchor pa):base(pa) { CanCompress = pa.CanCompress; content=null; // contentStream="%stream\r"; contentStream=""; }
float _y; // y location on page /// <summary> /// Create the image Dictionary /// </summary> public PdfOutlineEntry(PdfAnchor pa, int p, string text, float x, float y) : base(pa) { _p = p; _x = x; _y = y; _text = text; }
public PdfCatalog(PdfAnchor pa, string l):base(pa) { if (l != null) lang = String.Format("/Lang({0})", l); else lang = ""; }
/// <summary> /// Create the font Dictionary /// </summary> public PdfFontEntry(PdfAnchor pa, string fontName, string fontFace) : base(pa) { font = fontName; fontDict = string.Format("\r\n{0} 0 obj<</Type/Font/Name /{1}/BaseFont/{2}/Subtype/Type1/Encoding /WinAnsiEncoding>>\tendobj\t", this.objectNum, fontName, fontFace); //fontDict = string.Format("\r\n{0} 0 obj<</Type/Font/Name /{1}/BaseFont/{2}/Subtype/Type1>>\tendobj\t", // this.objectNum, fontName, fontFace); }
/// <summary> /// Create the image Dictionary /// </summary> public PdfImageEntry(PdfAnchor pa, PdfPage p, int contentRef, string nm, ImageFormat imgf, byte[] im, int width, int height) : base(pa) { name = nm; imf = imgf; ba = im; string filter; string colorSpace; if (imf == ImageFormat.Jpeg) { filter = "/DCTDecode"; switch (JpgParser.GetColorSpace(ref im)) { case 0: colorSpace = "/DeviceRGB"; break; case 1: colorSpace = "/DeviceGray"; break; case 3: colorSpace = "/DeviceRGB"; break; case 4: colorSpace = "/DeviceCMYK"; break; default: colorSpace = "/DeviceRGB"; break; } } else if (imf == ImageFormat.Png) // TODO: this still doesn't work { filter = "/FlateDecode /DecodeParms <</Predictor 15 /Colors 3 /BitsPerComponent 8 /Columns 80>>"; colorSpace = "/DeviceRGB"; } else if (imf == ImageFormat.Gif) // TODO: this still doesn't work { filter = "/LZWDecode"; colorSpace = "/DeviceRGB"; } else { filter = ""; colorSpace = ""; } imgDict = string.Format("\r\n{0} 0 obj<</Type/XObject/Subtype /Image /Width {1} /Height {2} /ColorSpace {5} /BitsPerComponent 8 /Length {3} /Filter {4} >>\nstream\n", this.objectNum, width, height, ba.Length, filter, colorSpace); p.AddResource(this, contentRef); }
public PdfCatalog(PdfAnchor pa, string l) : base(pa) { if (l != null) { lang = String.Format("/Lang({0})", l); } else { lang = ""; } }
/// <summary> /// Create the font Dictionary /// </summary> public PdfPatternEntry(PdfAnchor pa, String patternName, String patternType) : base(pa) { pattern = patternName; switch (patternType) { case "BackwardDiagonal": patternDict = BackwardDiagonal(); break; case "DarkDownwardDiagonal": patternDict = DarkDownwardDiagonal(); break; case "DarkHorizontal": patternDict = DarkHorizontal(); break; case "Vertical": patternDict = Vertical(); break; case "OutlinedDiamond": patternDict = OutlinedDiamond(); break; case "LargeConfetti": patternDict = LargeConfetti(); break; case "SmallConfetti": patternDict = SmallConfetti(); break; case "HorizontalBrick": patternDict = HorizontalBrick(); break; case "DiagonalBrick": patternDict = DiagonalBrick(); break; case "SolidDiamond": patternDict = SolidDiamond(); break; case "Cross": patternDict = Cross(); break; case "CheckerBoard": patternDict = CheckerBoard(); break; } }
public PdfPage(PdfAnchor pa) : base(pa) { resourceDict = null; contents = null; pageSize = null; fontRef = null; imageRef = null; annotsDict = null; colorSpaceRef = null; patternRef = null; }
public PdfPage(PdfAnchor pa):base(pa) { resourceDict=null; contents=null; pageSize=null; fontRef=null; imageRef=null; annotsDict=null; colorSpaceRef=null; patternRef=null; }
public void Start() { // Create the anchor for all pdf objects CompressionConfig cc = RdlEngineConfig.GetCompression(); anchor = new PdfAnchor(cc != null); //Create a PdfCatalog string lang; if (r.ReportDefinition.Language != null) { lang = r.ReportDefinition.Language.EvaluateString(this.r, null); } else { lang = null; } catalog = new PdfCatalog(anchor, lang); //Create a Page Tree Dictionary pageTree = new PdfPageTree(anchor); //Create a Font Dictionary fonts = new PdfFonts(anchor); //Create a Pattern Dictionary patterns = new PdfPattern(anchor); //Create an Image Dictionary images = new PdfImages(anchor); //Create an Outline Dictionary outline = new PdfOutline(anchor); //Create the info Dictionary info = new PdfInfo(anchor); //Set the info Dictionary. info.SetInfo(r.Name, r.Author, r.Description, ""); // title, author, subject, company //Create a utility object pdfUtility = new PdfUtility(anchor); //write out the header int size = 0; tw.Write(pdfUtility.GetHeader("1.5", out size), 0, size); filesize = size; }
public void Start() { // Create the anchor for all pdf objects CompressionConfig cc = RdlEngineConfig.GetCompression(); anchor = new PdfAnchor(cc != null); //Create a PdfCatalog string lang; if (r.ReportDefinition.Language != null) lang = r.ReportDefinition.Language.EvaluateString(this.r, null); else lang = null; catalog= new PdfCatalog(anchor, lang); //Create a Page Tree Dictionary pageTree= new PdfPageTree(anchor); //Create a Font Dictionary fonts = new PdfFonts(anchor); //Create a Pattern Dictionary patterns = new PdfPattern(anchor); //Create an Image Dictionary images = new PdfImages(anchor); //Create an Outline Dictionary outline = new PdfOutline(anchor); //Create the info Dictionary info=new PdfInfo(anchor); //Set the info Dictionary. info.SetInfo(r.Name,r.Author,r.Description,""); // title, author, subject, company //Create a utility object pdfUtility=new PdfUtility(anchor); //write out the header int size=0; tw.Write(pdfUtility.GetHeader("1.5",out size),0,size); filesize = size; }
float _y; // y location on page /// <summary> /// Create the image Dictionary /// </summary> public PdfOutlineEntry(PdfAnchor pa, int p, string text, float x, float y ):base(pa) { _p = p; _x = x; _y = y; _text = text; }
public PdfPattern(PdfAnchor a) { pa = a; patterns = new Hashtable(); }
public PdfPageTree(PdfAnchor pa) : base(pa) { kids = "[ "; MaxPages = 0; }
public PdfPageTree(PdfAnchor pa):base(pa) { kids="[ "; MaxPages=0; }
/// <summary> /// Create the font Dictionary /// </summary> public PdfPatternEntry(PdfAnchor pa,String patternName,String patternType):base(pa) { pattern = patternName; switch (patternType) { case "BackwardDiagonal": patternDict = BackwardDiagonal(); break; case "DarkDownwardDiagonal": patternDict = DarkDownwardDiagonal(); break; case "DarkHorizontal": patternDict = DarkHorizontal(); break; case "Vertical": patternDict = Vertical(); break; case "OutlinedDiamond": patternDict = OutlinedDiamond(); break; case "LargeConfetti": patternDict = LargeConfetti(); break; case "SmallConfetti": patternDict = SmallConfetti(); break; case "HorizontalBrick": patternDict = HorizontalBrick(); break; case "DiagonalBrick": patternDict = DiagonalBrick(); break; case "SolidDiamond": patternDict = SolidDiamond(); break; case "Cross": patternDict = Cross(); break; case "CheckerBoard": patternDict = CheckerBoard(); break; } }
/// <summary> /// Constructor increments the object number to /// reflect the currently used object number /// </summary> protected PdfBase(PdfAnchor pa) { xref = pa; xref.current++; objectNum = xref.current; }
public PdfOutline(PdfAnchor pa) { _pa = pa; bookmarks = new List<PdfOutlineEntry>(); }
public PdfUtility(PdfAnchor p) { pa = p; numTableEntries = 0; }
public PdfFonts(PdfAnchor a) { pa = a; fonts = new Hashtable(); }
public PatternObj(PdfAnchor pa) : base(pa) { Patternobj = string.Format("\r\n{0} 0 obj\r\n [ /Pattern /DeviceRGB ]\r\n endobj", this.objectNum); }
public PatternObj(PdfAnchor pa):base(pa) { Patternobj = string.Format("\r\n{0} 0 obj\r\n [ /Pattern /DeviceRGB ]\r\n endobj",this.objectNum); }
/// <summary> /// Create the image Dictionary /// </summary> public PdfImageEntry(PdfAnchor pa, PdfPage p, int contentRef, string nm, ImageFormat imgf, byte[] im, int width, int height):base(pa) { name=nm; imf = imgf; ba=im; string filter; string colorSpace; if (imf == ImageFormat.Jpeg) { filter = "/DCTDecode"; switch (JpgParser.GetColorSpace(ref im)) { case 0: colorSpace = "/DeviceRGB"; break; case 1: colorSpace = "/DeviceGray"; break; case 3: colorSpace = "/DeviceRGB"; break; case 4: colorSpace = "/DeviceCMYK"; break; default: colorSpace = "/DeviceRGB"; break; } } else if (imf == ImageFormat.Png) // TODO: this still doesn't work { filter = "/FlateDecode /DecodeParms <</Predictor 15 /Colors 3 /BitsPerComponent 8 /Columns 80>>"; colorSpace = "/DeviceRGB"; } else if (imf == ImageFormat.Gif) // TODO: this still doesn't work { filter = "/LZWDecode"; colorSpace = "/DeviceRGB"; } else { filter = ""; colorSpace = ""; } imgDict=string.Format("\r\n{0} 0 obj<</Type/XObject/Subtype /Image /Width {1} /Height {2} /ColorSpace {5} /BitsPerComponent 8 /Length {3} /Filter {4} >>\nstream\n", this.objectNum,width, height, ba.Length, filter, colorSpace); p.AddResource(this, contentRef); }
public PdfImages(PdfAnchor a) { pa = a; images = new Hashtable(); }
public PdfOutlineMain(PdfAnchor pa) : base(pa) { }
/// <summary> /// Create the font Dictionary /// </summary> public PdfFontEntry(PdfAnchor pa,string fontName,string fontFace):base(pa) { font=fontName; fontDict = string.Format("\r\n{0} 0 obj<</Type/Font/Name /{1}/BaseFont/{2}/Subtype/Type1/Encoding /WinAnsiEncoding>>\tendobj\t", this.objectNum, fontName, fontFace); //fontDict = string.Format("\r\n{0} 0 obj<</Type/Font/Name /{1}/BaseFont/{2}/Subtype/Type1>>\tendobj\t", // this.objectNum, fontName, fontFace); }
public PdfOutline(PdfAnchor pa) { _pa = pa; bookmarks = new List <PdfOutlineEntry>(); }
/// <summary> /// Constructor increments the object number to /// reflect the currently used object number /// </summary> protected PdfBase(PdfAnchor pa) { xref=pa; xref.current++; objectNum=xref.current; }
public PdfInfo(PdfAnchor pa) : base(pa) { info = null; }
public PdfInfo(PdfAnchor pa):base(pa) { info=null; }