First, sorry if this is redundant to another post that I could not find.
We have a need to capture Webpage articles without the ads and other extraneous stuff. Some of the webpages like WSJ do not have an existing print preview option page but when you use the browser print preview the page is formatted how we need it captured.
Is there a Aspose.PDf method that will enable use to use the browser print function to PDF?
Can you please share some details regarding your requirement i.e. either you need convert Web page to PDF format or get the option to generate a preview image of web page ? Please share the details so we may reply accordingly.
PS, Aspose.Pdf for .NET offers the feature to convert web pages to PDF format and when performing conversion, all the contents over web page are also rendered in output file. For further details, please visit Convert PDF File into HTML Format
Our requirement is to convert news articles from certain webpages (Wall Street Journal, American Banker, etc) into PDF and store it. The actual webpage contains a lot of irrelevant items like ads, pop-ups, header, trailer, pictures, videos, etc… in addition to the news article. We would like to have only the news article in our PDF and remove all the other unnecessary stuff. As of now when we convert the webpage all the ads, pop-ups, videos are also getting into the PDF. The reason we are asking about the browser print preview or print to PDF is some of the articles render the articles without the irrelevant ads, etc…
Is there any way we could achieve this in Aspose ?
I am afraid currently Aspose.Pdf cannot trim specific contents. (videos,images etc.) while converting HTML files to PDF format. However for the sake of implementation, I have logged this requirement in our issue tracking system under New Features list as PDFNEWNET-38693. We will further investigate this requirement in details and will keep you updated on the status of a correction.
That functionality would be great and would fix the workaround we are looking at. What we really want to know is if there is a function to have a browsers print function print to an Aspose PDF function to create the PDF. In many of the news sites the print function automatically removes the ads and other junk.
Is there a way to programmically print to an PDF or capture the print Preview of the browser to PDF using your software?
As per my understanding, you need to have a feature to enable/add some option for print preview stating Print via Aspose.Pdf and during printing, it should remove Ads and other unnecessary information over the web page. If so is the case, then I am afraid we might tot be able to add such option to existing applications but once the earlier logged feature is implemented, you will be able to use it in your custom application.
In case I have not properly understood the requirement, please feel free to contact.
Actually we wanted these separated as 2 distinct features. We want to be able to remove the ads and other unnecessary information from web pages. This is the main objective. But, we have found a possible workaround if we can print to PDF. I take it that Aspose does not offer a print to PDF function. Correct?
If the sections you want to hide have consistent ID/class/tag, you can use your own css to hide these sections (and pass the css using htmlloadoptions). You just need to inject the css reference to the html before converting it to PDF.
During the implementation of earlier reported feature, we will try to introduce the mechanism in API to parse the un-necessary contents and trim them during conversion. Once we are able to accomplish this, we may consider introducing a feature to trim specific objects only. However as soon as we have some further updates, we will let you know.
However currently you can use this API to print existing PDF files. So if you have any PDF file generated from HTML (which does not contain any un-necessary objects), you can use our API to print the documents. For more information, please visit Working with PDF printing (Facades)
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
Enables storage, such as cookies, related to analytics.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.