乔山办公网我们一直在努力
您的位置:乔山办公网 > word文档 > 怎么把png格式转换为<em>pdf</em>格式-word convert to pdf,pd

怎么把png格式转换为<em>pdf</em>格式-word convert to pdf,pd

作者:乔山办公网日期:

返回目录:word文档


对于文档处理控件Aspose.words,它的具有代表性的功能是在没有安装Microsoft Word的情况下,也能实现生成、打印、渲染、邮件合并,文档格式转换等功能。今天在使用Aspose.Words过程中,意外的发现这款文档处理软件的另外一个功能,它可以将图像转换为PDF文件,接下来就为大家分享一下实e69da5e887aae79fa5e98193339现这一功能的具体代码:

using System;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Reflection;
 
using Aspose.Words;
using Aspose.Words.Drawing;
 
namespace ImageToPdf
{
    class Program
    {
        public static void Main(string[] args)
        {
            // Sample infrastructure.
            string exeDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + Path.DirectorySeparatorChar;
            string dataDir = new Uri(new Uri(exeDir), @"../../Data/").LocalPath;
 
            ConvertImageToPdf(dataDir + "Test.jpg", dataDir + "TestJpg Out.pdf");
            ConvertImageToPdf(dataDir + "Test.png", dataDir + "TestPng Out.pdf");
            ConvertImageToPdf(dataDir + "Test.wmf", dataDir + "TestWmf Out.pdf");
            ConvertImageToPdf(dataDir + "Test.tiff", dataDir + "TestTiff Out.pdf");
            ConvertImageToPdf(dataDir + "Test.gif", dataDir + "TestGif Out.pdf");
        }
 
        /// <summary>
        /// Converts an image to PDF using Aspose.Words for .NET.
        /// </summary>
        /// <param name="inputFileName">File name of input image file.</param>
        /// <param name="outputFileName">Output PDF file name.</param>
        public static void ConvertImageToPdf(string inputFileName, string outputFileName)
        {
            // Create Aspose.Words.Document and DocumentBuilder.
            // The builder makes it simple to add content to the document.
            Document doc = new Document();
            DocumentBuilder builder = new DocumentBuilder(doc);
 
            // Read the image from file, ensure it is disposed.
            using (Image image = Image.FromFile(inputFileName))
            {
                // Find which dimension the frames in this image represent. For example 
                // the frames of a BMP or TIFF are "page dimension" whereas frames of a GIF image are "time dimension". 
                FrameDimension dimension = new FrameDimension(image.FrameDimensionsList[0]); 
 
                 // Get the number of frames in the image.
                int framesCount = image.GetFrameCount(dimension);
 
                // Get the number of frames in the image.
                int framesCount = image.GetFrameCount(FrameDimension.Page);
 
                // Loop through all frames.
                for (int frameIdx = 0; frameIdx < framesCount; frameIdx++)
                {
                    // Insert a section break before each new page, in case of a multi-frame TIFF.
                    if (frameIdx != 0)
                        builder.InsertBreak(BreakType.SectionBreakNewPage);
 
                    // Select active frame.
                    image.SelectActiveFrame(dimension, frameIdx);
 
                    // We want the size of the page to be the same as the size of the image.
                    // Convert pixels to points to size the page to the actual image size.
                    PageSetup ps = builder.PageSetup;
                    ps.PageWidth = ConvertUtil.PixelToPoint(image.Width, image.HorizontalResolution);
                    ps.PageHeight = ConvertUtil.PixelToPoint(image.Height, image.VerticalResolution);
 
                    // Insert the image into the document and position it at the top left corner of the page.
                    builder.InsertImage(
                        image,
                        RelativeHorizontalPosition.Page,
                        0,
                        RelativeVerticalPosition.Page,
                        0,
                        ps.PageWidth,
                        ps.PageHeight,
                        WrapType.None);
                }
            }
 
            // Save the document to PDF.
            doc.Save(outputFileName);
        }
    }
}


怎么把png格式转换为pdf格式


用虚拟打印机制作和转换PDF文件,软件有:
1.PDFFactory Pro虚拟打印机,安装后,在任何文档中,选择打印时,选择打印机为pdfFactoryPro,就能生成PDF文件,并可以进行安全设置。
2.InstallTinyPDF虚拟打印机.
3.tinypdf是免费的pdf虚拟打印机;
4.虚拟打印机(Virtual Printer);

5.SmartPrinter(Doc Pdf xls to pdf/tiff/bmp/jpg/png)一款大家非常熟悉的经典产品,专为转换文件
而研发的高品质打印驱动,以运行稳定、转换速度快和图像质量高而著称,通过虚拟打印技术可以完美的将任e79fa5e98193e59b9ee7ad94331意可打印文档转换成 PDF、TIFF、JPEG,BMP、PNG、EMF、GIF、TXT格式。
6.雪莹DocConvert虚拟打印转换。雪莹DocConvert是一款文档转化工具,它通过虚拟打印的技术将任何文档转化为PDF,JPG,BMP,TIFF,PCX,PNG等等文档格式。
当然还可以用:
1.用Solid Converter PDF Professional 可以在PDF与WORD互相转换,也就可以编辑了;
2.abobe acrobat Professional 也有部分编辑功能,网上有PJ的软件。

方法一:是先e69da5e887aae799bee5baa6e79fa5e98193333将JPG图片方到word或WPS中编辑好,然后再由word转换成成PDF。
具体方法:首先打开word或WPS并插入需要转换成PDF的图片,编辑排版好。然后选择文件—另存为—输出为PDF格式。
这种方法在需要编辑多张图片是比较麻烦,需要排版编辑好,对于文字形式的图片也只能以图片的形式放入到word中进行编辑,不能对途中的文字进行编辑,对于想编辑图片中文字的来说只能在word中打字加上截图。
方法二:直接使用JPG转换成PDF转换器进行转换,jpg转换成PDF转换器 。
具体方法:首先选择您需要使用的模式,如果需要将文件转化为PDF,点击左上角的"图片转PDF"模式。
  然后点击左下角的的"添加文件",把需要转换的文件添加进来,一次可添加多个文件。同时选择转换后文件需要保存的位置。
  最好点击右边"开始转换"按钮,等待片刻即可。
  这种方法方便快捷,可以一次批量转换多种图片,可以将图片分别转换PDF文档或是将所有图片合并成一个PDF文档,在转换时选择对应的选项即可。
方法三:使用FreePic2Pdf软件,进行批量转换;
方法四:使用虚拟打印机pdf factory即可,而且其他格式文件只要是能够打印,选择这个虚拟打印机,都可以做成PDF文件,很简单实用;用其他虚拟打印机转成PDF文件。

相关阅读

  • <em>mac</em>上<em>pdf</em>怎么转换成<em

  • 乔山办公网word文档
  • 苹果电脑怎么把pdf转成wordpdf转成word" src="/uploads/tu/437.jpg" style="width: 400px; height: 267px;" />苹果电脑怎么把pdf转成wordMAC OS系统中如何将PDF转换成WORD?" src="/uploads/tu/
  • <em>java</em> 怎么把<em>pdf</em>转成<e

  • 乔山办公网word文档
  • 用Java内嵌iText生成PDF文档需要5个步骤:百①建立com.lowagie.text.Document对象的实例。Document document = new Document();②建立一个度书写器(Writer)与document对象关知联,通过书道写器(Writer)可以将文
  • <em>word</em>转<em>PDF</em>有什么<em&

  • 乔山办公网word文档
  • 最简单的方法可百以通过在线pdf转换器来实现。步骤度1:打开迅捷PDF转换器在线平台选择“PDF转Word”转换模式。步骤2:点击“选择文件回”按钮,上传需要转换的PDF文件。步骤3:上传
  • 请问有没有福昕<em>pdf</em>转<em>word</em> &l

  • 乔山办公网word文档
  • 好象不行吧。你自己百度一个其它的PDF转换WORD的软件或百方法试试:1.用Adobe Acrobat XI Pro打开PDF文档,另存WORD格式。2.泰比(ABBYY) FineReader 11 是高智度能的文本识别、文本转换和扫描识别
关键词不能为空
极力推荐

ppt怎么做_excel表格制作_office365_word文档_365办公网