• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# pdf.PdfDestination类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中iTextSharp.text.pdf.PdfDestination的典型用法代码示例。如果您正苦于以下问题:C# PdfDestination类的具体用法?C# PdfDestination怎么用?C# PdfDestination使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



PdfDestination类属于iTextSharp.text.pdf命名空间,在下文中一共展示了PdfDestination类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: CreateNamedInstanceFor

        public INamedDestination CreateNamedInstanceFor(Dictionary<string, object> iDestination)
        {
            // TODO: Either verify that these settings are okay by default, or make them configuration injectable.
            var uniqueIdentifier = Guid.NewGuid().ToString().Replace("-", string.Empty);
            var page = 0;
            var typeParam = -1.0f;
            var type = 0;
            if (iDestination.ContainsKey("Title"))
            {
                var title = _nameProvider.GetName(iDestination["Title"].ToString());
                if (!string.IsNullOrEmpty(title))
                {
                    uniqueIdentifier = title;
                }
            }
            if (iDestination.ContainsKey("Page"))
            {
                var matches = Regex.Match(iDestination["Page"].ToString(), @"(?'page'\d*) (?'type'\w*) (?'typeParam'\d*)");
                if (!string.IsNullOrEmpty(matches.Groups["page"].Value))
                {
                    page = Int32.Parse(matches.Groups["page"].Value);
                }
                if (!string.IsNullOrEmpty(matches.Groups["type"].Value))
                {
                    type = GetPDFViewType(matches.Groups["type"].Value);
                }
                if (!string.IsNullOrEmpty(matches.Groups["typeParam"].Value))
                {
                    typeParam = float.Parse(matches.Groups["typeParam"].Value);
                }
            }

            var destination = new PdfDestination(type, typeParam);
            return new NamedDestinationImpl(uniqueIdentifier, page, destination);
        }
开发者ID:CaffeineMachine,项目名称:TextSharpUtils,代码行数:35,代码来源:NamedDestinationFactory.cs


示例2: ManipulatePdf

 // ---------------------------------------------------------------------------    
 /**
  * Manipulates a PDF file src with the file dest as result
  * @param src the original PDF
  */
 public byte[] ManipulatePdf(byte[] src)
 {
     // Create the reader
     PdfReader reader = new PdfReader(src);
     int n = reader.NumberOfPages;
     using (MemoryStream ms = new MemoryStream())
     {
         // Create the stamper
         using (PdfStamper stamper = new PdfStamper(reader, ms))
         {
             // Make a list with all the possible actions
             actions = new List<PdfAction>();
             PdfDestination d;
             for (int i = 0; i < n; )
             {
                 d = new PdfDestination(PdfDestination.FIT);
                 actions.Add(PdfAction.GotoLocalPage(++i, d, stamper.Writer));
             }
             // Add a navigation table to every page
             PdfContentByte canvas;
             for (int i = 0; i < n; )
             {
                 canvas = stamper.GetOverContent(++i);
                 CreateNavigationTable(i, n).WriteSelectedRows(0, -1, 696, 36, canvas);
             }
         }
         return ms.ToArray();
     }
 }
开发者ID:kuujinbo,项目名称:iTextInAction2Ed,代码行数:34,代码来源:TimetableDestinations.cs


示例3: GenPdfDailyBatteryAllCust

        public void GenPdfDailyBatteryAllCust(string TempFolderPath, string ImageFileName, string ReportPeriod, string ProcessDate)
        {
            //this creates a new destination to send the action to when the document is opened. The zoom in this instance is set to 0.75f (75%). Again I use doc.PageSize.Height to set the y coordinate to the top of the page. PdfDestination.XYZ is a specific PdfDestination Type that allows us to set the location and zoom.
            PdfDestination pdfDest = new PdfDestination(PdfDestination.XYZ, 0, _doc.PageSize.Height, 1.00f);
            _doc.Open();

            string imageURL_VinSplash = Path.Combine(TempFolderPath, "VinCoverPage.png");
            iTextSharp.text.Image jpg_VinSplash = iTextSharp.text.Image.GetInstance(imageURL_VinSplash);

            //Resize image depend upon your need
            jpg_VinSplash.ScalePercent(65f);

            //Give space before image
            jpg_VinSplash.SpacingBefore = 10f;

            //Give some space after the image
            jpg_VinSplash.SpacingAfter = 1f;
            jpg_VinSplash.Alignment = Element.ALIGN_CENTER;

            _doc.Add(jpg_VinSplash);

            PdfPTable table = GenerateBatteryAllCustDashboard(ProcessDate);

            _doc.Add(table);

            GenerateBatteryChartByCustVin(TempFolderPath, ProcessDate);

            PdfAction action = PdfAction.GotoLocalPage(1, pdfDest, _writer);

            //    //set the open action for our writer object
            _writer.SetOpenAction(action);
        }
开发者ID:kiranmath,项目名称:PcanRepository,代码行数:32,代码来源:CreateReports.cs


示例4: ManipulatePdf

 public void ManipulatePdf(String src, String dest)
 {
     PdfReader reader = new PdfReader(src);
     PdfStamper stamper = new PdfStamper(reader, new FileStream(dest, FileMode.Create));
     Rectangle linkLocation = new Rectangle(523, 770, 559, 806);
     PdfDestination destination = new PdfDestination(PdfDestination.FIT);
     PdfAnnotation link = PdfAnnotation.CreateLink(stamper.Writer,
         linkLocation, PdfAnnotation.HIGHLIGHT_INVERT,
         3, destination);
     stamper.AddAnnotation(link, 1);
     stamper.Close();
 }
开发者ID:newlysoft,项目名称:itextsharp,代码行数:12,代码来源:AddLinkAnnotation.cs


示例5: AddNavigationTest

 public void AddNavigationTest()  {
     String src = srcFolder + "primes.pdf";
     String dest = outFolder + "primes_links.pdf";
     PdfReader reader = new PdfReader(src);
     PdfStamper stamper = new PdfStamper(reader, new FileStream(dest, FileMode.Create));
     PdfDestination d = new PdfDestination(PdfDestination.FIT);
     Rectangle rect = new Rectangle(0, 806, 595, 842);
     PdfAnnotation a10 = PdfAnnotation.CreateLink(stamper.Writer, rect, PdfAnnotation.HIGHLIGHT_INVERT, 2, d);
     stamper.AddAnnotation(a10, 1);
     PdfAnnotation a1 = PdfAnnotation.CreateLink(stamper.Writer, rect, PdfAnnotation.HIGHLIGHT_PUSH, 1, d);
     stamper.AddAnnotation(a1, 2);
     stamper.Close();
     CompareTool compareTool = new CompareTool();
     String errorMessage = compareTool.CompareByContent(dest, srcFolder + "cmp_primes_links.pdf", outFolder, "diff_");
     if (errorMessage != null) {
         Assert.Fail(errorMessage);
     }
 }
开发者ID:newlysoft,项目名称:itextsharp,代码行数:18,代码来源:NamedDestinationsTest.cs


示例6: CreateMoviePage

 // ---------------------------------------------------------------------------
 /**
  * Creates the PDF.
  * @return the bytes of a PDF file.
  */
 public byte[] CreateMoviePage(Movie movie)
 {
     using (MemoryStream ms = new MemoryStream()) {
     // step 1
     using (Document document = new Document()) {
       // step 2
       PdfWriter.GetInstance(document, ms);
       // step 3
       document.Open();
       // step 4
       Paragraph p = new Paragraph(
     movie.MovieTitle,
     FontFactory.GetFont(
       BaseFont.HELVETICA, BaseFont.WINANSI, BaseFont.NOT_EMBEDDED, 16
     )
       );
       document.Add(p);
       document.Add(Chunk.NEWLINE);
       PdfPTable table = new PdfPTable(WIDTHS);
       table.AddCell(Image.GetInstance(
     String.Format(RESOURCE, movie.Imdb)
       ));
       PdfPCell cell = new PdfPCell();
       cell.AddElement(new Paragraph("Year: " + movie.Year.ToString()));
       cell.AddElement(new Paragraph("Duration: " + movie.Duration.ToString()));
       table.AddCell(cell);
       document.Add(table);
       PdfDestination dest = new PdfDestination(PdfDestination.FIT);
       dest.AddFirst(new PdfNumber(1));
       PdfTargetDictionary target = new PdfTargetDictionary(false);
       Chunk chunk = new Chunk("Go to original document");
       PdfAction action = PdfAction.GotoEmbedded(null, target, dest, false);
       chunk.SetAction(action);
       document.Add(chunk);
     }
     return ms.ToArray();
       }
 }
开发者ID:kuujinbo,项目名称:iTextInAction2Ed,代码行数:43,代码来源:KubrickBox.cs


示例7: PdfOutline

 /**
  * Constructs a <CODE>PdfOutline</CODE>.
  * <P>
  * This is the constructor for an <CODE>outline entry</CODE>.
  *
  * @param parent the parent of this outline item
  * @param destination the destination for this outline item
  * @param title the title of this outline item
  * @param open <CODE>true</CODE> if the children are visible
  */
 public PdfOutline(PdfOutline parent, PdfDestination destination, string title, bool open)
     : base()
 {
     this.destination = destination;
     InitOutline(parent, title, open);
 }
开发者ID:medvedttn,项目名称:itextsharp_mod-src,代码行数:16,代码来源:PdfOutline.cs


示例8: LocalDestination

 /**
  * The local destination to where a local goto with the same
  * name will jump.
  * @param name the name of this local destination
  * @param destination the <CODE>PdfDestination</CODE> with the jump coordinates
  * @return <CODE>true</CODE> if the local destination was added,
  * <CODE>false</CODE> if a local destination with the same name
  * already exists
  */
 public bool LocalDestination(string name, PdfDestination destination)
 {
     return pdf.LocalDestination(name, destination);
 }
开发者ID:HardcoreSoftware,项目名称:iSecretary,代码行数:13,代码来源:PdfContentByte.cs


示例9: Write

 public override void Write(PdfWriter writer, Document doc) {
     PdfDestination destination = new PdfDestination(PdfDestination.XYZ, 20,
             writer.GetVerticalPosition(false), 0);
     IDictionary<String, Object> memory = context.GetMemory();
     HeaderNode tree = null;
     if (memory.ContainsKey(HtmlPipelineContext.BOOKMARK_TREE))
         tree = (HeaderNode)memory[HtmlPipelineContext.BOOKMARK_TREE];
     int level = header.GetLevel(tag);
     if (null == tree) {
         // first h tag encounter
         tree = new HeaderNode(0, writer.RootOutline, null);
     }
     else {
         // calculate parent
         int lastLevel = tree.Level;
         if (lastLevel == level) {
             tree = tree.Parent;
         }
         else if (lastLevel > level) {
             while (lastLevel >= level) {
                 lastLevel = tree.Parent.Level;
                 tree = tree.Parent;
             }
         }
     }
     if (LOGGER.IsLogging(Level.TRACE)) {
         LOGGER.Trace(String.Format(LocaleMessages.GetInstance().GetMessage(LocaleMessages.ADD_HEADER), title.ToString()));
     }
     HeaderNode node = new HeaderNode(level, new PdfOutline(tree.Outline, destination, title), tree);
     memory[HtmlPipelineContext.BOOKMARK_TREE] = node;
 }
开发者ID:yu0410aries,项目名称:itextsharp,代码行数:31,代码来源:Header.cs


示例10: PdfNamedDestinationsOverflow

        public void PdfNamedDestinationsOverflow() {
            Document document = new Document();
            PdfAWriter writer = PdfAWriter.GetInstance(document, new FileStream(OUT + "pdfNamedDestinationsOverflow.pdf", FileMode.Create), PdfAConformanceLevel.PDF_A_1A);
            writer.CreateXmpMetadata();
            writer.SetTagged();
            document.Open();
            document.AddLanguage("en-US");

            Font font = FontFactory.GetFont(RESOURCES + "FreeMonoBold.ttf", BaseFont.WINANSI, BaseFont.EMBEDDED, 12);
            document.Add(new Paragraph("Hello World", font));
            FileStream iccProfileFileStream = File.Open(RESOURCES + "sRGB Color Space Profile.icm", FileMode.Open, FileAccess.Read, FileShare.Read);
            ICC_Profile icc = ICC_Profile.GetInstance(iccProfileFileStream);
            iccProfileFileStream.Close();

            writer.SetOutputIntents("Custom", "", "http://www.color.org", "sRGB IEC61966-2.1", icc);

            PdfDocument pdf = writer.PdfDocument;
            for (int i = 0; i < 8200; i++) {
                PdfDestination dest = new PdfDestination(PdfDestination.FITV);
                pdf.LocalDestination("action" + i, dest);
            }
            document.Close();
        }
开发者ID:Niladri24dutta,项目名称:itextsharp,代码行数:23,代码来源:PdfA1CheckerTest.cs


示例11: GotoLocalPage

 /** Creates a GoTo action to an internal page.
  * @param page the page to go. First page is 1
  * @param dest the destination for the page
  * @param writer the writer for this action
  * @return a GoTo action
  */    
 public static PdfAction GotoLocalPage(int page, PdfDestination dest, PdfWriter writer) {
     PdfIndirectReference piref = writer.GetPageReference(page);
     PdfDestination d = new PdfDestination(dest);
     d.AddPage(piref);
     PdfAction action = new PdfAction();
     action.Put(PdfName.S, PdfName.GOTO);
     action.Put(PdfName.D, d);
     return action;
 }
开发者ID:yu0410aries,项目名称:itextsharp,代码行数:15,代码来源:PdfAction.cs


示例12: AppendOutline

 /// <summary>
 /// 新しいアウトラインを登録する
 /// </summary>
 /// <param name="level">階層構造のレベル(1以上)</param>
 /// <param name="title">見出し文字列</param>
 /// <param name="cb">PDFデータ</param>
 /// <returns>生成されたアウトラインのパス</returns>
 public void AppendOutline(int level, UString title, PdfContentByte cb)
 {
     AppendOutlineNode(level, title);
     var path = Path(_currentNode);
     var destination = new PdfDestination(PdfDestination.INDIRECT);
     var added = cb.LocalDestination(path, destination);
 }
开发者ID:karak,项目名称:Geovanni,代码行数:14,代码来源:PdfOutlineBuilder.cs


示例13: OnParagraph

 public override void OnParagraph(PdfWriter writer, Document document, float position) {
     PdfContentByte cb = writer.DirectContent;
     PdfDestination destination = new PdfDestination(PdfDestination.FITH, position);
     new PdfOutline(cb.RootOutline, destination, TITLE);
 }
开发者ID:Niladri24dutta,项目名称:itextsharp,代码行数:5,代码来源:BookmarksTest.cs


示例14: LocalDestination

 /**
 * The local destination to where a local goto with the same
 * name will jump to.
 * @param name the name of this local destination
 * @param destination the <CODE>PdfDestination</CODE> with the jump coordinates
 * @return <CODE>true</CODE> if the local destination was added,
 * <CODE>false</CODE> if a local destination with the same name
 * already existed
 */
 internal bool LocalDestination(String name, PdfDestination destination) {
     Destination dest;
     if (localDestinations.ContainsKey(name))
         dest = localDestinations[name];
     else
         dest = new Destination();
     if (dest.destination != null)
         return false;
     dest.destination = destination;
     localDestinations[name] = dest;
     if (!destination.HasPage())
         destination.AddPage(writer.CurrentPage);
     return true;
 }
开发者ID:NelsonSantos,项目名称:fyiReporting-Android,代码行数:23,代码来源:PdfDocument.cs


示例15: AddNamedDestination

 /**
 * Adds one named destination.
 * @param    name    the name for the destination
 * @param    page    the page number where you want to jump to
 * @param    dest    an explicit destination
 * @since    iText 5.0
 */
 virtual public void AddNamedDestination(String name, int page, PdfDestination dest) {
     PdfDestination d = new PdfDestination(dest);
     d.AddPage(GetPageReference(page));
     pdf.LocalDestination(name, d);
 }
开发者ID:joshaxey,项目名称:Simple-PDFMerge,代码行数:12,代码来源:PdfWriter.cs


示例16: GenPdfDailyBattery

        private void GenPdfDailyBattery(string TempFolderPath, string ImageFileName, string ReportPeriod)
        {
            //this creates a new destination to send the action to when the document is opened. The zoom in this instance is set to 0.75f (75%). Again I use doc.PageSize.Height to set the y coordinate to the top of the page. PdfDestination.XYZ is a specific PdfDestination Type that allows us to set the location and zoom.
            PdfDestination pdfDest = new PdfDestination(PdfDestination.XYZ, 0, _doc.PageSize.Height, 1.00f);
            _doc.Open();

            //string imageURL_VinSplash = @ImageFileName;
            //iTextSharp.text.Image jpg_VinSplash = iTextSharp.text.Image.GetInstance(imageURL_VinSplash);

            string imageURL_VinSplash = Path.Combine(TempFolderPath, "VinCoverPage.png");
            iTextSharp.text.Image jpg_VinSplash = iTextSharp.text.Image.GetInstance(imageURL_VinSplash);

            //Resize image depend upon your need
            jpg_VinSplash.ScalePercent(75f);

            //Give space before image
            jpg_VinSplash.SpacingBefore = 10f;

            //Give some space after the image
            jpg_VinSplash.SpacingAfter = 1f;
            jpg_VinSplash.Alignment = Element.ALIGN_CENTER;

            _doc.Add(jpg_VinSplash);
            _doc.NewPage();

            string imageURL_VinDash = Path.Combine(TempFolderPath, "VinDashboard.png");
            iTextSharp.text.Image jpg_VinDash = iTextSharp.text.Image.GetInstance(imageURL_VinDash);
            //Resize image depend upon your need
            //jpg.ScaleToFit(chartWidth, chartHeight);
            // jpg_VinHist.ScaleToFit(600f, 250f);
            jpg_VinDash.ScalePercent(60f);

            //Give space before image
            jpg_VinDash.SpacingBefore = 10f;
            //Give some space after the image
            jpg_VinDash.SpacingAfter = 1f;
            jpg_VinDash.Alignment = Element.ALIGN_CENTER;
            _doc.Add(jpg_VinDash);

            string imageURL_SoCByPacks_Min = Path.Combine(TempFolderPath, "SoCByPacks_Min.png");
            iTextSharp.text.Image jpg_SoCByPacks_Min = iTextSharp.text.Image.GetInstance(imageURL_SoCByPacks_Min);
            //Resize image depend upon your need
            //jpg.ScaleToFit(chartWidth, chartHeight);
            // jpg_VinHist.ScaleToFit(600f, 250f);
            jpg_SoCByPacks_Min.ScalePercent(60f);

            //Give space before image
            jpg_SoCByPacks_Min.SpacingBefore = 10f;
            //Give some space after the image
            jpg_SoCByPacks_Min.SpacingAfter = 1f;
            jpg_SoCByPacks_Min.Alignment = Element.ALIGN_CENTER;
            _doc.Add(jpg_SoCByPacks_Min);

             string imageURL_SoCByPacks_Max = Path.Combine(TempFolderPath, "SoCByPacks_Max.png");
            iTextSharp.text.Image jpg_SoCByPacks_Max = iTextSharp.text.Image.GetInstance(imageURL_SoCByPacks_Max);
            //Resize image depend upon your need
            //jpg.ScaleToFit(chartWidth, chartHeight);
            // jpg_VinHist.ScaleToFit(600f, 250f);
            jpg_SoCByPacks_Max.ScalePercent(60f);

            //Give space before image
            jpg_SoCByPacks_Max.SpacingBefore = 10f;
            //Give some space after the image
            jpg_SoCByPacks_Max.SpacingAfter = 1f;
            jpg_SoCByPacks_Max.Alignment = Element.ALIGN_CENTER;
            _doc.Add(jpg_SoCByPacks_Max);

             string imageURL_CurrentByPacks = Path.Combine(TempFolderPath, "CurrentByPacks.png");
            iTextSharp.text.Image jpg_CurrentByPacks = iTextSharp.text.Image.GetInstance(imageURL_CurrentByPacks);
            //Resize image depend upon your need
            //jpg.ScaleToFit(chartWidth, chartHeight);
            // jpg_VinHist.ScaleToFit(600f, 250f);
            jpg_CurrentByPacks.ScalePercent(60f);

            //Give space before image
            jpg_CurrentByPacks.SpacingBefore = 10f;
            //Give some space after the image
            jpg_CurrentByPacks.SpacingAfter = 1f;
            jpg_CurrentByPacks.Alignment = Element.ALIGN_CENTER;
            _doc.Add(jpg_CurrentByPacks);

            string imageURL_TMaxByPacks_Max = Path.Combine(TempFolderPath, "TMaxByPacks.png");
            iTextSharp.text.Image jpg_TMaxByPacks_Max = iTextSharp.text.Image.GetInstance(imageURL_TMaxByPacks_Max);
            //Resize image depend upon your need
            //jpg.ScaleToFit(chartWidth, chartHeight);
            // jpg_VinHist.ScaleToFit(600f, 250f);
            jpg_TMaxByPacks_Max.ScalePercent(60f);

            //Give space before image
            jpg_TMaxByPacks_Max.SpacingBefore = 10f;
            //Give some space after the image
            jpg_TMaxByPacks_Max.SpacingAfter = 1f;
            jpg_TMaxByPacks_Max.Alignment = Element.ALIGN_CENTER;
            _doc.Add(jpg_TMaxByPacks_Max);

               PdfAction action = PdfAction.GotoLocalPage(1, pdfDest, _writer);

            //    //set the open action for our writer object
                _writer.SetOpenAction(action);
        }
开发者ID:kiranmath,项目名称:PcanRepository,代码行数:100,代码来源:CreateReports.cs


示例17: NamedDestinationImpl

 public NamedDestinationImpl(string name, int page, PdfDestination destination)
 {
     Name = name;
     Page = page;
     Destination = destination;
 }
开发者ID:CaffeineMachine,项目名称:TextSharpUtils,代码行数:6,代码来源:NamedDestinationFactory.cs


示例18: Add


//.........这里部分代码省略.........
                    AddSpacing(paragraph.SpacingAfter, paragraph.Leading, paragraph.Font);

                    if (pageEvent != null && isParagraph)
                        pageEvent.OnParagraphEnd(writer, this, IndentTop - currentHeight);

                    alignment = Element.ALIGN_LEFT;
                    indentLeft -= paragraph.IndentationLeft;
                    indentRight -= paragraph.IndentationRight;
                    CarriageReturn();
                    break;
                }
                case Element.SECTION:
                case Element.CHAPTER: {
                    // Chapters and Sections only differ in their constructor
                    // so we cast both to a Section
                    Section section = (Section) element;

                    bool hasTitle = section.Title != null;

                    // if the section is a chapter, we begin a new page
                    if (section.TriggerNewPage) {
                        NewPage();
                    }
                    // otherwise, we begin a new line
                    else {
                        NewLine();
                    }

                    if (hasTitle) {
                    float fith = IndentTop - currentHeight;
                    int rotation = pageSize.Rotation;
                    if (rotation == 90 || rotation == 180)
                        fith = pageSize.Height - fith;
                    PdfDestination destination = new PdfDestination(PdfDestination.FITH, fith);
                    while (currentOutline.Level >= section.Depth) {
                        currentOutline = currentOutline.Parent;
                    }
                    PdfOutline outline = new PdfOutline(currentOutline, destination, section.GetBookmarkTitle(), section.BookmarkOpen);
                    currentOutline = outline;
                    }

                    // some values are set
                    CarriageReturn();
                    indentLeft += section.IndentationLeft;
                    indentRight += section.IndentationRight;
                    sectionIndentL += section.IndentationLeft;
                    sectionIndentR += section.IndentationRight;
                    IPdfPageEvent pageEvent = writer.PageEvent;
                    if (pageEvent != null)
                        if (element.Type == Element.CHAPTER)
                            pageEvent.OnChapter(writer, this, IndentTop - currentHeight, section.Title);
                        else
                            pageEvent.OnSection(writer, this, IndentTop - currentHeight, section.Depth, section.Title);

                    // the title of the section (if any has to be printed)
                    if (hasTitle) {
                        isParagraph = false;
                        Add(section.Title);
                        isParagraph = true;
                    }
                    indentLeft += section.Indentation;
                    sectionIndentL += section.Indentation;
                    // we process the section
                    element.Process(this);
                    // some parameters are set back to normal again
                    indentLeft -= section.IndentationLeft + section.Indentation;
开发者ID:hjgode,项目名称:iTextSharpCF,代码行数:67,代码来源:PdfDocument.cs


示例19: GenPdfWeekly

        private void GenPdfWeekly(string TempFolderPath, string ImageFileName, string ReportPeriod)
        {
            //this creates a new destination to send the action to when the document is opened. The zoom in this instance is set to 0.75f (75%). Again I use doc.PageSize.Height to set the y coordinate to the top of the page. PdfDestination.XYZ is a specific PdfDestination Type that allows us to set the location and zoom.
            PdfDestination pdfDest = new PdfDestination(PdfDestination.XYZ, 0, _doc.PageSize.Height, 1.00f);

            _doc.Open();

            //string imageURL_VinSplash = @ImageFileName;
            //iTextSharp.text.Image jpg_VinSplash = iTextSharp.text.Image.GetInstance(imageURL_VinSplash);

            string imageURL_VinSplash = Path.Combine(TempFolderPath, "VinCoverPage.png");
            iTextSharp.text.Image jpg_VinSplash = iTextSharp.text.Image.GetInstance(imageURL_VinSplash);

            //Resize image depend upon your need
            jpg_VinSplash.ScalePercent(65f);

            //Give space before image
            jpg_VinSplash.SpacingBefore = 10f;

            //Give some space after the image
            jpg_VinSplash.SpacingAfter = 1f;
            jpg_VinSplash.Alignment = Element.ALIGN_CENTER;

            _doc.Add(jpg_VinSplash);
            _doc.NewPage();

            string imageURL_VinDash = Path.Combine(TempFolderPath, "VinDashboard.png");
            iTextSharp.text.Image jpg_VinDash = iTextSharp.text.Image.GetInstance(imageURL_VinDash);
            //Resize image depend upon your need
            //jpg.ScaleToFit(chartWidth, chartHeight);
            // jpg_VinHist.ScaleToFit(600f, 250f);
            jpg_VinDash.ScalePercent(75f);

            //Give space before image
            jpg_VinDash.SpacingBefore = 10f;
            //Give some space after the image
            jpg_VinDash.SpacingAfter = 1f;
            jpg_VinDash.Alignment = Element.ALIGN_CENTER;
            _doc.Add(jpg_VinDash);
            _doc.NewPage();

            string imageURL_VinHist = Path.Combine(TempFolderPath, "VinSpeedHist.png");

            iTextSharp.text.Image jpg_VinHist = iTextSharp.text.Image.GetInstance(imageURL_VinHist);
            //Resize image depend upon your need
            //jpg.ScaleToFit(chartWidth, chartHeight);
            // jpg_VinHist.ScaleToFit(600f, 250f);
            jpg_VinHist.ScalePercent(85f);

            //Give space before image
            jpg_VinHist.SpacingBefore = 10f;
            //Give some space after the image
            jpg_VinHist.SpacingAfter = 1f;
            jpg_VinHist.Alignment = Element.ALIGN_CENTER;

            _doc.Add(jpg_VinHist);
            string imageURL_VinEffHist = Path.Combine(TempFolderPath, "VinEfficiencyHist.png");

            iTextSharp.text.Image jpg_VinEffHist = iTextSharp.text.Image.GetInstance(imageURL_VinEffHist);
            //Resize image depend upon your need
            //jpg.ScaleToFit(chartWidth, chartHeight);
            // jpg_VinHist.ScaleToFit(600f, 250f);
            jpg_VinEffHist.ScalePercent(85f);

            //Give space before image
            jpg_VinEffHist.SpacingBefore = 10f;
            //Give some space after the image
            jpg_VinEffHist.SpacingAfter = 1f;
            jpg_VinEffHist.Alignment = Element.ALIGN_CENTER;

            _doc.Add(jpg_VinEffHist);

            string imageURL_VinAccelPedalHist = Path.Combine(TempFolderPath, "VinAccelPedalHist.png");

            iTextSharp.text.Image jpg_VinAccelPedalHist = iTextSharp.text.Image.GetInstance(imageURL_VinAccelPedalHist);
            //Resize image depend upon your need
            //jpg.ScaleToFit(chartWidth, chartHeight);
            // jpg_VinHist.ScaleToFit(600f, 250f);
            jpg_VinAccelPedalHist.ScalePercent(85f);

            //Give space before image
            jpg_VinAccelPedalHist.SpacingBefore = 10f;
            //Give some space after the image
            jpg_VinAccelPedalHist.SpacingAfter = 1f;
            jpg_VinAccelPedalHist.Alignment = Element.ALIGN_CENTER;

            _doc.Add(jpg_VinAccelPedalHist);

            string imageURL_VinBrakePedalHist = Path.Combine(TempFolderPath, "VinBrakePedalHist.png");

            iTextSharp.text.Image jpg_VinBrakePedalHist = iTextSharp.text.Image.GetInstance(imageURL_VinBrakePedalHist);
            //Resize image depend upon your need
            //jpg.ScaleToFit(chartWidth, chartHeight);
            // jpg_VinHist.ScaleToFit(600f, 250f);
            jpg_VinBrakePedalHist.ScalePercent(85f);

            //Give space before image
            jpg_VinBrakePedalHist.SpacingBefore = 10f;
            //Give some space after the image
            jpg_VinBrakePedalHist.SpacingAfter = 1f;
//.........这里部分代码省略.........
开发者ID:kiranmath,项目名称:PcanRepository,代码行数:101,代码来源:CreateReports.cs


示例20: LocalDestination

 /**
 * The local destination to where a local goto with the same
 * name will jump to.
 * @param name the name of this local destination
 * @param destination the <CODE>PdfDestination</CODE> with the jump coordinates
 * @return <CODE>true</CODE> if the local destination was added,
 * <CODE>false</CODE> if a local destination with the same name
 * already existed
 */
 internal bool LocalDestination(String name, PdfDestination destination) {
     Object[] obj = (Object[])localDestinations[name];
     if (obj == null)
         obj = new Object[3];
     if (obj[2] != null)
         return false;
     obj[2] = destination;
     localDestinations[name] = obj;
     if (!destination.HasPage())
         destination.AddPage(writer.CurrentPage);
     return true;
 }
开发者ID:pusp,项目名称:o2platform,代码行数:21,代码来源:PdfDocument.cs



注:本文中的iTextSharp.text.pdf.PdfDestination类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# pdf.PdfDictionary类代码示例发布时间:2022-05-26
下一篇:
C# pdf.PdfCopy类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap