This is an archived forum post. The information may be outdated. Contact us if you have any questions.

PDFcrowd .dll for ASP.NET c# application

cheriaan wrote on 2013-04-10:
Hi,
i would like to use the pdfcorwd, but i don't know from where i should get the pdfcrowd .dll for ASP.NET c# application ?.

Thanks
Anish
support wrote on 2013-04-10:
Hello,

Please follow the installation instructions: http://pdfcrowd.com/api/html-to-pdf-dotnet/#install
cheriaan wrote on 2013-04-16:
Thank you so much.

If i am running my application in intranet ,how can i use this API ?

Thanks
Aniesh
cheriaan wrote on 2013-04-16:
How can i genarate the Fusion chart graph using this API ?

Thanks
Aniesh
support wrote on 2013-04-17:
Hello Aniesh,

You can use the API in your intranet application providing that your network configuration allows sending HTTP POST to our server. Another thing is that the convertURI() API function is limited to public URLs and it is not possible to use it for intranet URLs. But you can still use convertHtml() and convertFile().


As to Fusion Charts, please refer to this thread: https://pdfcrowd.com/forum/archive/read/?3,346,1371#msg-1371
cheriaan wrote on 2013-04-17:
Thanks,

I had use the above script and the result is same as old one,its a blank pdf, there is my sample html code.

thanka
Aniesh
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>MHUP User Count</title>
<script src="FusionCharts/FusionCharts.js" type="text/javascript"></script>
<link href="style/StyleSheet.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="http://yourdomain.com/path/to/Charts/jquery.min.js"></script>
<script type="text/javascript" src="http://yourdomain.com/path/to//Charts/highcharts.js"></script>
</head>
<body>
<form id="form2" runat="server">
<table width="100%">
<tr>
<td align="center" width="5%"></td>
<td align="center" width="90%"></td>
<td align="center" width="5%"></td>
</tr>
<tr>
<td align="center" width="5%"></td>
<td align="center" width="90%">
<div class="divstyle">
<table width="50%">
<tr>
<td align="center" colspan="2" style="height: 80%">
<asp:Image ID="Image1" runat="server" ImageUrl="~/images/IST_banner_2.jpg"/>
</td>
</tr>
<tr>
<td align="center" class="mainheadCopy" colspan="2">
Microsoft Home Use Program</td>

</tr>
<tr>
<td align="right" width="50%">
</td>
<td width="50%" align="right">

</tr>

<tr>
<td align="right" width="50%">
</td>
<td width="50%" align="right">
<asp:Label ID="Label3" runat="server" Visible="false" CssClass="bodytextbold" Text="Date : "></asp:Label>

<asp:Label ID="lbldate" runat="server" CssClass="redtext" Text="Label"></asp:Label></td>
</tr>

<tr>
<td align="right" colspan="2" rowspan="3">
<asp:Literal ID="chart" runat="server"></asp:Literal></td>
</tr>
<tr>
</tr>
<tr>
</tr>
<tr>
<td colspan="2">
<asp:Label ID="lblError" runat="server" CssClass="redtext"></asp:Label></td>
</tr>
<tr>
<td align="center" colspan="2" width="100%">
<asp:Button ID="btnPDF" runat="server" OnClick="btnPDF_Click" Text="PDF" />&nbsp;</td>
</tr>
</table>
</div>
</td>
<td align="center" width="5%"></td>
</tr>

</table>
</form>
</body>
</html>
support wrote on 2013-04-19:
Hello,

If you use convertHtml() or convertFile() you have to specify public absolute URLs for resources linked from your HTML code. This means that the resources (javascript, stylesheets, images) must be publicly available somewhere. For example, instead of
<script src="FusionCharts/FusionCharts.js" type="text/javascript"></script> 

you need to use
<script src="http://some-public-server.com/FusionCharts/FusionCharts.js" type="text/javascript"></script> 
cheriaan wrote on 2013-04-26:
Thanks for the Responce.

Do we have any option for auto save the pdf file into the application host server. if yes please send me the sample code.

Thanks
Aniesh
support wrote on 2013-04-28:
You can use FileStream to save a generated PDF on the server:
pdfcrowd.Client client = new pdfcrowd.Client("***", "***");

FileStream fileStream = new FileStream("c:/mypdfs/my.pdf", FileMode.CreateNew);
client.convertHtml($yourHtmlCode, fileStream);
fileStream.Close();
cheriaan wrote on 2013-04-30:
Thanks for the reply.its working.
my free tokens are over can you please give me a bunch for more testing.

User Id id # cherian

Thanks
Aniesh
support wrote on 2013-04-30:
Hello Aniesh,

I have just added extra 100 testing tokens to your account.
cheriaan wrote on 2013-05-02:
Thank you so much.
cheriaan wrote on 2013-05-03:
Hi ,

this is my code for generating the PDF.

How can i specify the top, bottam, left and right margin for the page.

FileStream fileStream = new FileStream(Server.MapPath("~//PDF//ISOHead.PDF"), FileMode.CreateNew);
pdfcrowd.Client client = new pdfcrowd.Client(strUID, strPWD);
client.convertHtml(strMsg1, fileStream);
fileStream.Close();

Thanks
Aniesh
support wrote on 2013-05-06:
Hello Aniesh,

Use the setPageMargins API method. An example:
client.setPageMargins(".3in", ".25in", ".25in", ".2in");


Please make sure that you are using the latest version of the client library as this method was added recently.