Ejemplo n.º 1
0
        public static int WriteColorSpace(TPdfStream DataStream, TXRefSection XRef)
        {
            int Result = XRef.GetNewObject(DataStream);

            TPdfBaseRecord.Write(DataStream, TPdfTokens.GetString(TPdfToken.PatternColorSpacePrefix) + " ");
            TIndirectRecord.CallObj(DataStream, Result);

            return(Result);
        }
Ejemplo n.º 2
0
 public static void WriteColorSpaceObject(TPdfStream DataStream, TXRefSection XRef, int ColorSpaceId)
 {
     XRef.SetObjectOffset(ColorSpaceId, DataStream);
     TIndirectRecord.SaveHeader(DataStream, ColorSpaceId);
     TPdfBaseRecord.Write(DataStream, TPdfTokens.GetString(TPdfToken.OpenArray));
     TDictionaryRecord.SaveKey(DataStream, TPdfToken.PatternName, TPdfTokens.GetString(TPdfToken.DeviceRGBName));
     TPdfBaseRecord.Write(DataStream, TPdfTokens.GetString(TPdfToken.CloseArray));
     TIndirectRecord.SaveTrailer(DataStream);
 }
Ejemplo n.º 3
0
 public void WriteImage(TPdfStream DataStream, TXRefSection XRef)
 {
     TPdfBaseRecord.Write(DataStream, TPdfTokens.GetString(TPdfToken.ImgPrefix) + Id.ToString(CultureInfo.InvariantCulture) + " ");
     ImgObjId = XRef.GetNewObject(DataStream);
     TIndirectRecord.CallObj(DataStream, ImgObjId);
     if (FSMask != null)
     {
         SMaskId = XRef.GetNewObject(DataStream);
     }
 }
Ejemplo n.º 4
0
        private void SaveAction(TPdfStream DataStream, TXRefSection XRef)
        {
            XRef.SetObjectOffset(ActionId, DataStream);
            TIndirectRecord.SaveHeader(DataStream, ActionId);
            BeginDictionary(DataStream);

            TPdfBaseRecord.Write(DataStream,
                                 String.Format(CultureInfo.InvariantCulture, TPdfTokens.GetString(TPdfToken.LinkData), FURL));

            EndDictionary(DataStream);
            TIndirectRecord.SaveTrailer(DataStream);
        }
Ejemplo n.º 5
0
        public static void WriteStringInStream(TPdfStream DataStream, string Text, real FontSize, TPdfFont aFont, ref string LastFont, string EndNewText, string StartNewText2, string EndNewText2, TTracedFonts TracedFonts)
        {
            TPdfFont LastFallbackFont = aFont;
            int      StartText        = 0;

            int TLen = Text.Length;

            for (int i = 0; i <= TLen; i++)
            {
                TPdfFont FallbackFont = null;

                if (i < TLen)
                {
                    FallbackFont = aFont.Fallback(Text[i], 0);
                    if (FallbackFont == null)
                    {
                        FallbackFont = aFont;
                    }
                }

                if (FallbackFont != LastFallbackFont)
                {
                    WriteSimpleString(DataStream, Text.Substring(StartText, i - StartText), LastFallbackFont, EndNewText);

                    StartText = i;

                    if (FallbackFont != null)
                    {
                        TPdfBaseRecord.Write(DataStream, EndNewText2);
                        FallbackFont.Select(DataStream, FontSize, ref LastFont);

                        if (FlexCelTrace.HasListeners && FallbackFont != aFont && !TracedFonts.ContainsKey(aFont.FontName + ";" + FallbackFont.FontName))
                        {
                            TracedFonts.Add(aFont.FontName + ";" + FallbackFont.FontName, String.Empty);
                            FlexCelTrace.Write(new TPdfUsedFallbackFontError(FlxMessages.GetString(FlxErr.ErrUsedFallbackFont, aFont.FontName, FallbackFont.FontName), aFont.FontName, FallbackFont.FontName));
                        }

                        TPdfBaseRecord.Write(DataStream, StartNewText2);
                        LastFallbackFont = FallbackFont;
                    }
                }
            }
        }
Ejemplo n.º 6
0
 public void WritePattern(TPdfStream DataStream, TXRefSection XRef)
 {
     TPdfBaseRecord.Write(DataStream, TPdfTokens.GetString(PatternPrefix) + PatternId.ToString(CultureInfo.InvariantCulture) + " ");
     PatternObjId = XRef.GetNewObject(DataStream);
     TIndirectRecord.CallObj(DataStream, PatternObjId);
 }
Ejemplo n.º 7
0
 public void WriteGState(TPdfStream DataStream, TXRefSection XRef)
 {
     TPdfBaseRecord.Write(DataStream, GStateName + " ");
     GStateObjId = XRef.GetNewObject(DataStream);
     TIndirectRecord.CallObj(DataStream, GStateObjId);
 }
Ejemplo n.º 8
0
 public virtual void WriteFont(TPdfStream DataStream, TXRefSection XRef)
 {
     TPdfBaseRecord.Write(DataStream, TPdfTokens.GetString(TPdfToken.FontPrefix) + Id.ToString(CultureInfo.InvariantCulture) + " ");
     FontObjId = XRef.GetNewObject(DataStream);
     TIndirectRecord.CallObj(DataStream, FontObjId);
 }