Sending html file through SendLetterAndAddressV2

I am using SendLetterAndAddressV2 and sending html.
Here is a piece of my code:

byte[] data = Encoding.ASCII.GetBytes(html);

PostalWSSimpleSoapClient postalMethods = new PostalWSSimpleSoapClient(_endpointName);

int responseId = postalMethods.SendLetterAndAddressV2(_userName, _password, description, "html", data,
mode , address.AttentionLine1, address.AttentionLine2, address.AttentionLine3, address.CompanyName,
address.AddressLine1, address.AttentionLine2, address.City, address.State, address.ZipCode, address.Country);

in html variable I have a simple string like this:

<table width="300" height="400" style="background:Gray;">
		<img width="150" height="150" src="https://XXXX/XXX/XX/XXX/3881"/>

I get it processed successfully but when I try to view it as pdf doc in CP I see the blank page.
Am I doing something wrong? How can I see my html doc rendered in pdf file?


Any suggestions? Thank you.

Any suggestions?

Thank you.

const string MyUsername =

const string MyUsername = "XXXXX";
			const string MyPassword = "XXXXX";
			const string MyDescription = "Sending a letter using C#";
			const string MyFileExtension = "html";
			const string MyPathToFile = @"C:/temp.html";
			const com.postalmethods.api.WorkMode MyWorkMode = com.postalmethods.api.WorkMode.Default;
			const string MyAttention1 = "George Washington";
			const string MyAttention2 = "";
			const string MyCompanyName = "The White House";
			const string MyAddress1 = "1600 Pennsylvania Ave NW";
			const string MyAddress2 = "";
			const string MyCity = "Washington";
			const string MyState = "DC";
			const string MyPostalCode = "20500";
			const string MyCountry = "United States of America";
			com.postalmethods.api.PostalWSSoapClient objPM = new com.postalmethods.api.PostalWSSoapClient("PostalWSSoap12");
			long lngResult = 0;
			// Read your binary document. In this example: C:\MyFile.pdf
			FileStream objFR = default(FileStream);
			objFR = new FileStream(MyPathToFile, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
			byte[] B = new byte[objFR.Length];
			objFR.Read(B, 0, B.Length);
			objFR = null;
			// Invoke the SendLetter method
			lngResult = objPM.SendLetterAndAddress(MyUsername, MyPassword, MyDescription, MyFileExtension, B, MyWorkMode, MyAttention1, MyAttention2, MyCompanyName,
			MyAddress1, MyAddress2, MyCity, MyState, MyPostalCode, MyCountry);
			// Check response status
			if (lngResult > 0)
				// A positive value means the message was successfully queued for processing.
				// The PostalMethods Letter ID is returned.
				Console.WriteLine("LetterID is: " + lngResult);
				// A negative value means an error occurred.
				// See the PostalMethods Status Codes:
				Console.WriteLine("Error is:" + lngResult);
			// In debug mode, the following lines prevent your console application from closing automatically upon termination
			Console.WriteLine("Hit ENTER to terminate application");
Here is the complete code I am using to send an html doc. I copied it from samples.
I can send a pdf docs normally and I am able to see them in CP, but if I send an html all I see is a blank pdf in CP.
Any suggestions?

@galimk, I checked the last

@galimk, I checked the last HTML you sent and it seems rather empty. There is an <img src> leading to an empty page. I recommend you make a test with a simple HTML containing some text just to make sure there is nothing wrong with HTML. Then use Internet Explorer 7 locally and make sure that the SRC is returning content. If it does and you still get blank PDFs, please check if the expected data is available when browsing from outside your internal network.

Please note that since background colors and images are not printed by default, we do not print the specified background and so you do not see it in the PDF but you do see it when you open the HTML you send us.

David O.
PostalMethods Support

Thank you for response! I

Thank you for response!

I will try to use an html doc with text content tomorrow.
I was sending a table with a background and an image which apparently are not printed by default!

Images are printed by

Images are printed by default but your image source is not leading to one. Images and colors set as Background are not printed.