Free Support Forum - aspose.com

Evaluating Aspose as an alternative to cloud convert

The feature set required is

  1. Combine multiple files (html, pdf, doc, images) and generate a single word file.
  2. Option to pass header and footer as well while generating word file.

We are currently using cloudconvert services for the same. Facing some issues with them, that is why we are evaluating alternatives.

Please reply back asap.
If you can provide some examples implementing similar features, that would be really helpful.

@nipunjainindia,

Thanks for your interest in Aspose APIs. You can implement the following workflow to meet this requirement.

  1. Use Aspose.HTML for .NET API for HTML to PDF Conversion
  2. Use Aspose.Words for .NET API to Convert Word Document to PDF format
  3. Use Aspose.Imaging for .NET API to Convert Image to PDF
  4. When individual PDF files from all formats (HTML, DOC, Image) are produced, use Aspose.PDF for .NET API to Concatenate PDF Files into a Single PDF
  5. In the end, again use Aspose.PDF for .NET API to Convert PDF to DOC or DOCX format

The operations, that you can perform on headers/footers by using MS Word, can also be performed by using Aspose.Words for .NET APi. For example, please check the following section of documentation:
How to Create Headers Footers in Word Document by using DocumentBuilder

Please let us know if you have any troubles and we will be glad to look into this further for you.

Hi Team,

Cloud Convert gives an option to provide html for header and footer. The html is a seperate html doc in itself containing head (containing css) and body(containing html).

Do we have similar support with Aspose.

Regards,
Nipun Jain

Hi Team,

I am converting html to pdf, and passing header and footer html during conversion. Please find the code mentioned below.

string dataDir = “C:\Users\testing\Desktop\htmlFiles\”;
var loadoptions = new HtmlLoadOptions();
loadoptions.PageInfo.IsLandscape = false;
loadoptions.PageInfo.Width = 816; // PageSize.A4.Height;
loadoptions.PageInfo.Height = 1344; // PageSize.A4.Width;
loadoptions.PageInfo.Margin = new MarginInfo(15, 25, 15, 25);

        Document doc = new Document(dataDir + "Report_With_Issue.html", loadoptions);
        var ms1 = new MemoryStream();
        doc.Save(ms1, Aspose.Pdf.SaveFormat.Pdf);

        foreach (Page page in doc.Pages)
        {
            page.Header = new HeaderFooter();
            page.Header.Paragraphs.Add(new HtmlFragment("<div class=\"container\" style=\"height: 100px; overflow: hidden;\">< div class=\"logo-container\" style=\"height: 85px; overflow: hidden;\"><div class=\"left\" style=\"float: right;\"><img src = \"https://upload.wikimedia.org/wikipedia/en/thumb/4/41/Flag_of_India.svg/1200px-Flag_of_India.svg.png\" style=\"width:20px;\"></div><div class=\"content-container content-align-left reportHeader\" style=\"text-align: right;\"><p style = \"color: #000000; font-family: Times New Roman; font-size: 12pt; font-style: normal; font-weight: normal;\" >< span class=\"empty\">Page | </span><span class=\"page\"></span><span>&nbsp</span> Header</p></div></div></div>"));

            page.Footer = new HeaderFooter();
            page.Footer.Paragraphs.Add(new HtmlFragment("<h1>I am a Footer</h1>"));
        }
        doc.Save(dataDir + Guid.NewGuid() + ".pdf");

After conversion, we are getting this file479ebc87-1d2e-418d-8ea0-4cb56d9c2364.pdf (316.1 KB)

The header is containing html tags in it. Please have a look.

Regards,
Nipun Jain

Hi Team,

Do we have support for CSS3.

Regards,
Nipun Jain

@nipunjainindia

We have worked with the data shared by you and would like to update you that CSS3 is supported by Aspose.PDF for .NET API. Problem appears to be with the HTML string you are passing in below line of code:

page.Header.Paragraphs.Add(new HtmlFragment());

if you replace this line with below code then everything works as expected:

page.Header.Paragraphs.Add(new HtmlFragment("<h1>I am a Header</h1>"));

Please double check the HTML string and then share your kind feedback with us. We have tested it with sample HTML string as in attached file. HeaderSample.zip

Hi Team,

I have passed, attached file html to header. Please find attached the output pdf file.Testing header.zip (511.8 KB)

Please let us know, what we are doing wrong.

Regards,
Nipun Jain

Hi Team,

Can we have a call to speed up our evaluation process.

Regards,
Nipun Jain

Hi Team,

Do we have support for passing header and footer while using "Aspose.HTML for Cloud API Reference
" for HTML to PDF conversion.

Not able to find the option to pass header and footer for endpoints “PUT /html/convert/pdf” and “PUT /pdf/{name}/create/html”.

We are making calls for HTML -> PDF conversion using https://apireference.aspose.cloud.

Can we have a call to speed up our evaluation process.

Regards,
Nipun Jain

Hi Team,

We were also trying to put header/footer in a word dcument. Can you please guide us in acheiving that.

We took use of the below api :

Put /words/{name}/{sectionPath}/headersfooters "Insert to document header or footer " :
Not sure of the parameters to pass in this .

Moreover, Is this an api to put header/footer into an existing document? If you guys can share a working sample of putting header/footer to a word and pdf document. It would really be helpful.

Or share a sample raw http request along with headers/queryParams/paylod to achieve the same.

Thanks

@nipunjainindia

Thank you for sharing updated HTML file.

We have worked with attached file in proper format, and everything is working as expected. Please use the line of code in attached TXT file Sample Code.zip and add the header in generated PDF file.

    ...

    //Replace this line from attached file
    string test = "";

    foreach (Aspose.Pdf.Page page in doc.Pages)
    {
        page.Header = new Aspose.Pdf.HeaderFooter();
        page.Header.Paragraphs.Add(new HtmlFragment(test));

        page.Footer = new Aspose.Pdf.HeaderFooter();
        page.Footer.Paragraphs.Add(new HtmlFragment("<h1>I am a Footer</h1>"));
    }
    doc.Save(dataDir + "HeaderFooter_18.8.pdf");

Moreover, we do not provide technical support on phone as forums are recommended channel for discussion over technical issues. However you can discuss sales/licensing related queries with Sales team through numbers shared on Contact page.

For Cloud related queries, please create posts over Cloud forums and our colleague from Aspose.Cloud team will take care of your concerns.

Hi Team,

Thanks for the support.

We are trying to HTML -> PDF conversion using htmls for header and footer. The header is coming fine if we pass whole html doc string in header, but the same is not coming for footer.

If we pass “

I am a Footer

” as page.Footer.Paragraphs.Add(new HtmlFragment(“

I am a Footer

”)), it’s coming fine, but if we pass whole html doc in footer, it’s not coming.

Attaching code for reference
code.zip (2.3 KB)

Regards,
Nipun Jain

Hi Team,

We are doing HTML -> PDF conversion. While doing the conversion, the width and height of the generated pdf is much more than A4 size. We have tried passing width and height using code below

var loadoptions = new HtmlLoadOptions();
loadoptions.PageInfo.IsLandscape = false;
loadoptions.PageInfo.Width = PageSize.A4.Height;
loadoptions.PageInfo.Height = PageSize.A4.Width;
loadoptions.PageInfo.Margin = new MarginInfo(15, 50, 15, 50);

But is is not working as expected. Can you help us out here.
Moreover can you let us know, what is the unit type (px, inch etc) for width, height and margin. There is no documentation for the same.

Regards,
Nipun Jain

@nipunjainindia

Thank you for getting back to us.

We have been able to notice the problem while adding footer with HtmlFragment. A ticket with ID PDFNET-45347 has been logged in our issue management system for further investigation and resolution. The ticket ID has been linked with this thread so that you will receive notification as soon as the ticket is resolved.

Regarding page size problem, please create a separate post while sharing source and generated files so that we may try to reproduce and investigate it in our environment.

We are sorry for the inconvenience.

Hi team,

By when are we expecting PDFNET-45347 to be fixed and made available on live.

A post was split to a new topic: Problem while converting HTML to PDF

@nipunjainindia

The ticket PDFNET-45347 has recently been logged in our issue management system and is pending for investigations owing to previously logged tickets in the queue. It will be investigated on its due turn which may take some months. We will update you as soon as this ticket will be resolved. We appreciate your patience and comprehension in this regard.

However, we also offer Paid Support, where issues are used to be investigated with higher priority. Our customers, who have paid support subscription, report their issue there which are meant to be investigated urgently. In case your reported issue is a blocker, you may please consider subscribing for Paid Support. For further information, please visit Paid Support FAQs.