Hi,
We are trying to create the pdf from doc file which reads html file.
Below is code snippet we are using
string filename = DateTime.Now.ToString(“HH_mm_ss”);
string myDir = @“D:/HTMLTODOC/”;
Aspose.Words.Document wordDoc = new Aspose.Words.Document(myDir + “template-1.html”);
wordDoc.Save(myDir + filename + “.pdf”);
I am not able to attach html file so writing code below
Docx file gets created pretty fine but PDF has lot of margin every where, please try to generate the pdf from above code and html below
--------------HTML START--------------
@page {
size: A4;
margin: 0;
}
body
{
width: 900px;
}
/body table {
width: 100%;
}/
@media print {
body {
margin: 0;
border: initial;
border-radius: initial;
width: initial;
min-height: initial;
box-shadow: initial;
background: initial;
page-break-after: always;
}
}
|
REFERRING PRACTITIONER/Provider No |
|||||||||
«ContactType» |
||||||||||
436 Burwood Road |
||||||||||
Title |
Surname |
First |
DOB |
Sex |
||||||
«Title» |
«LastName» |
«FirstName» |
«Birthdate» |
«xfGender» |
||||||
Address: «Address 1» |
||||||||||
Suburb: «City» |
Post Code: «Postal Code» |
State: «State» |
||||||||
Home Ph: «Phone1Link_RecID» |
Work Ph: «Phone2Link_RecID» |
Mobile: «Phone3Link_RecID» |
||||||||
Medicare Number: «xfMedicareNumber» |
||||||||||
Medicare Assignment (Section 20A of the Health Insurance Act 1973) I assign my right to benefits to the approved Pathology Practitioner Who will render the requested pathology service(s) |
||||||||||
|
|
|||||||||
The information provided by you on this form will be used to access the benefit payable for services rendered. Its collection is authorized by law and its contents may be disclosed to the Department of Health and Ageing, to the person claiming the benefit for the service or to the person’s nominee. The person making the claim may be advised of your eligibility under the scheme |
||||||||||
Collected By |
Date |
Time |
||||||||
|
|
|
||||||||
|
|
|
||||||||
Clinical Notes/ Therapy |
Tests Requested |
LAB USE |
||||||||
Pt currently taking Bio identical Hormone Replacement Therapy. No Need to Fast |
|
|
||||||||
INSTRUCTIONS |
Blood test preferably to be taken between 8am – 10am |
|||||||||
|
|
|||||||||
------------HTML END------------
Please let me know what is issue.