Sign In  Sign Up Live-Chat

Put an Aspose.Words.Document into an Aspose.PDF.pdf

Last post 04-23-2007, 6:38 AM by yohannver. 14 replies.
Sort Posts: Previous Next
  •  04-20-2007, 3:20 AM 73812

    Put an Aspose.Words.Document into an Aspose.PDF.pdf

    Hi,
    Is it possible to do it and how?
    Thank you
    Yohann
     
  •  04-20-2007, 4:30 AM 73819 in reply to 73812

    Re: Put an Aspose.Words.Document into an Aspose.PDF.pdf

    Hi,

    Thank you for considering Aspose.

    1. You can convert any Word document to Pdf. Please refer to:

    http://www.aspose.com/Wiki/default.aspx/Aspose.Pdf/WordToPDF.html

    2. If you want to Add Word Document to an existing Pdf File. Then for this you should follow two steps:

    a) Convert theWord document to Pdf as mentioned in Point 1.

    b) Concatenate the Pdf made after converting from Word Document with the existing Pdf. Please refer to:

    http://www.aspose.com/Wiki/default.aspx/Aspose.Pdf.Kit/ConcatenatePDFDocuments.html

    If you need more help, please do let us know.

    Thanks.

    Adeel Ahmad
    Support Developer
    Aspose Changsha Team
    http://www.aspose.com/Wiki/default.aspx/Aspose.Corporate/ContactChangsha.html

     
  •  04-20-2007, 5:02 AM 73821 in reply to 73819

    Re: Put an Aspose.Words.Document into an Aspose.PDF.pdf

    Thanks for your answer.
    My last insctruction :
    pdf.Save("MyDocument.pdf");

    doesn't work. It products a PDF file of 0 octet.
     
  •  04-20-2007, 5:15 AM 73826 in reply to 73821

    Re: Put an Aspose.Words.Document into an Aspose.PDF.pdf

    Hi,

    Please explain in detail what you are doing then we can help you out. Are you converting Word to Pdf? If yes then what code you have write and if you can send me your sample documents, then I can understand your problem.

    Thanks.

    Adeel Ahmad
    Support Developer
    Aspose Changsha Team
    http://www.aspose.com/Wiki/default.aspx/Aspose.Corporate/ContactChangsha.html

     
  •  04-20-2007, 6:28 AM 73834 in reply to 73826

    Re: Put an Aspose.Words.Document into an Aspose.PDF.pdf

    It works!!!
    But is it normal that it takes 1 min to product the pdf file (the file produced : 119Ko)
    The instruction is : pdf.Save("myDocument.pdf");
    Thanks
     
  •  04-20-2007, 9:41 AM 73863 in reply to 73834

    Re: Put an Aspose.Words.Document into an Aspose.PDF.pdf

    Hi,

    Please add the following two lines before Save() function.

          pdf.IsTruetypeFontMapCached = true;

          pdf.TruetypeFontMapPath = Path.GetTempPath();

    Hope it will speed up the conversion.

    Thanks.

    Adeel Ahmad
    Support Developer
    Aspose Changsha Team
    http://www.aspose.com/Wiki/default.aspx/Aspose.Corporate/ContactChangsha.html

     
  •  04-23-2007, 2:14 AM 73985 in reply to 73863

    Re: Put an Aspose.Words.Document into an Aspose.PDF.pdf

    Hi,
    It works but I delete the line :
        pdf.IsImagesInXmlDeleteNeeded = true;
    Now it takes just 1 or 2 seconds :) It's great.
    Now I want to print this PDF file, I made this but it doesn't work and I don't know why :
    -------------------------------------------------------------------------------------------------------
                        this.innerDocumentBuilder.Document.Save(myDocument.xml, SaveFormat.AsposePdf);
                        Aspose.Pdf.Pdf pdf = new Aspose.Pdf.Pdf();
                        pdf.BindXML(
    myDocument.xml, null);

                        pdf.IsImagesInXmlDeleteNeeded = true;
                        pdf.IsTruetypeFontMapCached = true;
                        pdf.TruetypeFontMapPath = System.IO.Path.GetTempPath();
                        pdf.Save(
    myDocument.pdf);

                        Aspose.Pdf.Kit.PdfViewer printHelp = new Aspose.Pdf.Kit.PdfViewer();
                        printHelp.OpenPdfFile(
    myDocument.pdf);
                        printHelp.PrintDocument();
                        printHelp.ClosePdfFile();

    -------------------------------------------------------------------------------------------------------
    Thank you
    Yohann
     
  •  04-23-2007, 3:00 AM 73994 in reply to 73985

    Re: Put an Aspose.Words.Document into an Aspose.PDF.pdf

    Hi,

    Aspose.Pdf cann't print PDF files. To print your documents Aspose.Pdf.Kit will be used. Please refer to:

    http://www.aspose.com/wiki/default.aspx/Aspose.Pdf.Kit/PdfViewer.html

    [C#]

    Aspose.Pdf.Kit.PdfViewer viewer = new Aspose.Pdf.Kit.Viewer();

     //Open a Pdf file
    viewer.OpenPdfFile("ToPrint.pdf");

     //Print the Pdf document using default printer
    viewer.PrintDocument();

     //Close the current Pdf file
    viewer.ClosePdfFile();


    If you need more help, please do let us know.

    Thanks.

    Adeel Ahmad
    Support Developer
    Aspose Changsha Team
    http://www.aspose.com/Wiki/default.aspx/Aspose.Corporate/ContactChangsha.html

     

     
  •  04-23-2007, 3:07 AM 73995 in reply to 73994

    Re: Put an Aspose.Words.Document into an Aspose.PDF.pdf

    Attachment: Present (inaccessible)
    I tried like that and it works (the print). But there is 2 big problems!
    1. The openPdfFile take 5 minutes.
    2. The document printed has not the size of a normal page.
    I attach the pdf file and I let you try please.
    Yohann
     
  •  04-23-2007, 3:17 AM 73997 in reply to 73994

    Re: Put an Aspose.Words.Document into an Aspose.PDF.pdf

    Hi,

    I have checked with the same code and found no errors. Please explain what problem exactly you are having? The PrintDocument() function sends the Pdf File to the Default Printer Installed in the system. If you want to send the print to the specified printer then call PrintDocumentWithSetup function. If you still find problems, then send your sample documents and let us check it.

    Thanks.

    Adeel Ahmad
    Support Developer
    Aspose Changsha Team
    http://www.aspose.com/Wiki/default.aspx/Aspose.Corporate/ContactChangsha.html

     
  •  04-23-2007, 3:25 AM 73998 in reply to 73997

    Re: Put an Aspose.Words.Document into an Aspose.PDF.pdf

    Me this is the OpenPdfFile. It takes 5 minutes to open the pdf document wich is on my desktop.
    I don't know what to do.
     
  •  04-23-2007, 3:34 AM 74000 in reply to 73998

    Re: Put an Aspose.Words.Document into an Aspose.PDF.pdf

    Hi,

    I have reproduce the error of the image not displaying correctly with the document you send. But about the timing issue, it is taking not more than 6sec on my system. I will discuss this issue with the developers and we will let you know as soon as solution is found.

    Thanks.

    Adeel Ahmad
    Support Developer
    Aspose Changsha Team
    http://www.aspose.com/Wiki/default.aspx/Aspose.Corporate/ContactChangsha.html

     

     
  •  04-23-2007, 3:50 AM 74001 in reply to 74000

    Re: Put an Aspose.Words.Document into an Aspose.PDF.pdf

    I just download the last version of Aspose.Pdf and Aspose.Pdf.Kit and my code is :

                        this.innerDocumentBuilder.Document.Save(@"C:\Documents and Settings\Rodacom\Bureau\truc.xml", SaveFormat.AsposePdf);
                        Aspose.Pdf.Pdf pdf = new Aspose.Pdf.Pdf();
                        pdf.BindXML(@"C:\Documents and Settings\Rodacom\Bureau\truc.xml", null);

                        pdf.IsImagesInXmlDeleteNeeded = true;
                        pdf.IsTruetypeFontMapCached = true;
                        pdf.TruetypeFontMapPath = System.IO.Path.GetTempPath();
                        pdf.Save(@"C:\Documents and Settings\Rodacom\Bureau\truc.pdf");

                        Aspose.Pdf.Kit.PdfViewer printHelp = new Aspose.Pdf.Kit.PdfViewer();
                        printHelp.OpenPdfFile(@"C:\Documents and Settings\Rodacom\Bureau\truc.pdf"); //this one takes 5 minutes
                        printHelp.PrintDocumentWithSetup();
                        printHelp.ClosePdfFile();

    During this period of 5 minutes, it takes the 100% of the UC :(
    And you when you try with my code, it takes 6 seconds?
    You don't know where is it coming from(the 5 minutes) ?
    Thank you
    Yohann
     
  •  04-23-2007, 4:15 AM 74004 in reply to 74001

    Re: Put an Aspose.Words.Document into an Aspose.PDF.pdf

    Hi,

    I wonder why it is not taking much time on my PC. Our developers will check it and let you know.

    Thanks.

    Adeel Ahmad
    Support Developer
    Aspose Changsha Team
    http://www.aspose.com/Wiki/default.aspx/Aspose.Corporate/ContactChangsha.html

     
  •  04-23-2007, 6:38 AM 74018 in reply to 74004

    Re: Put an Aspose.Words.Document into an Aspose.PDF.pdf

    Try to open it in DEBUG mode (F5).
    It takes a long time whereas with Ctrl+F5 it's fast.
    It's weird.
     
View as RSS news feed in XML