Adding pixel tracking to doc and pdf

Hi,


I want to add pixel tracking to a doc file so that i am able to track the open rate of documents. I tried something like this :

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.insertHtml(
“<img src=“www.mypixeltrackingurl.com”” +
“height=“0” width=“0” visibility=“hidden” />”
);

doc.save("/home/" + “AsposeAddHyperlinks.doc”);


But i get the hit on this url when i create the doc, is there any way the image is not downloaded during doc creation time, but only when the doc is opened.
Hi Himanshi,

Thanks for your inquiry. Open rate tracking is a way to check how many of your contacts have opened (or viewed) the document. It seems that your query is more about the MS Word (Document viewer) behavior than Aspose.Words.

With Aspose.Words you can perform document processing tasks. Could you please share some more detail about your query along with expected output document? We will then provide you more information about your query along with code.

I need to add a dynamic image by inserting a specific url. So if i change the image at the url, the image should change in the doc as well.

This can only be achieved if the image i am inserting is not downloaded or stored at the time of url insertion.

So the expected output would be a doc file in which a url is inserted and that url gets hit only on document opening.
Hi Himanshi,

Thanks for your inquiry. In your case, we suggest you please use INCLUDEPICTURE field. Please use FieldIncludePicture.SourceFullName property to get or set the location of the picture using an IRI.

Please check the following code example. To get the updated image, you need to update the field in MS Word by pressing F9 key. Hope this helps you.

Document doc = new Document();
DocumentBuilder documentBuilder = new DocumentBuilder(doc);
long startTime = System.currentTimeMillis();
FieldIncludePicture fieldIncludePicture = (FieldIncludePicture )documentBuilder.insertField(FieldType.FIELD_INCLUDE_PICTURE, false);
fieldIncludePicture.setSourceFullName("http://www.aspose.com/images/aspose-logo.gif");

doc.save(MyDir + "17.6.docx");

Hi,


Thanks for the reply!
What will be the corresponding code for for pdf file?
Hi Himanshi,

Thanks for your inquiry. If you want to save the document to PDF, please change the extension in Document.Save method as show below. If this does not help you, please share some more detail about your query. We will then guide you accordingly.

doc.save(MyDir + "17.6.pdf");

Hi,
I do not want to save the file as html but add a similar image from a url into a pdf file. Is that possible using aspose.pdf?

Hi Himanshi,

Thanks for your inquiry. Your query is related to Aspose.Pdf API. I am moving this forum thread to Aspose.Total forum where you'll be guided appropriately.

himanshi.shakya:
Hi,
I do not want to save the file as html but add a similar image from a url into a pdf file. Is that possible using aspose.pdf?
Hi Himanshi,

Thanks for contacting support.

Currently the API supports the feature to load/reference an image from URL and place it inside the document. However currently it does not support the feature to add reference of remote Image so that it is loaded when viewing the document. For the sake of correction, I have logged it as PDFJAVA-36825 in our issue tracking system. We will further look into the details of this problem and will keep you posted on the status of correction. Please be patient and spare us little time. We are sorry for this inconvenience.

Hi,
Is the issue resolved ? If yes , please mention the solution.

Hi,
Is the issue resolved ?

@himanshi.shakya,

The linked ticket ID PDFJAVA-36825 is not resolved yet. We have logged an ETA request under the same ticket ID PDFJAVA-36825. We will let you know once a significant progress has been made in this regard.

Is the feature going to be extended for PDF NET also?

@BKS,

Aspose.PDF for Java API is an auto-ported version of its equivalent .NET version, so this feature will also be included in Aspose.PDF for .NET API.

Thanks Imran. Do you know if we have effective ETA for this particular fix?

We are in process getting our license upgraded (Ours expired in Feb, 2017) But this particular limitations in PDF is affecting the new renewal…

@BKS,

The linked ticket ID PDFJAVA-36825 is not resolved yet. We are getting the most recent status, and will let you know soon. Please confirm, are you working on the .NET platform?

Yes we are using .Net to process some office documents and looking to extend it to pdf.

@BKS,

This feature request has been logged under the ticket ID PDFNET-44706 for the .NET platform in our issue tracking system. We have linked your post to this ticket and will keep you informed regarding any available updates.

Hi - Any updates on this? We would like to know if this is worked upon or it is just staged as a low priority item?

@fireh,

The linked ticket ID PDFJAVA-36825 is dependent upon an internal ticket, and the ticket ID PDFNET-44706 is pending for the analysis. We will investigate as per the development schedules, and notify you regarding the fixed status of each ticket. In order to escalate priority, we recommend our clients to post their critical issues (ticket Ids) in the paid support forum. Please refer to this helping link: Aspose support options