[PDF] Merge all annotations type
(M)HTML to PDF conversion does not support Unicode
var pdf = new Pdf
{
HtmlInfo =
{
CharSet = "UTF-8",
CharsetApplyingLevelOfForce = HtmlInfo.CharsetApplyingForceLevel.EnforceUseAlways
}
};
pdf.SetUnicode();
var section = pdf.Sections.Add();
var text = new Text(section, htmlString)
{
IsHtmlTagSupported = true,
IsHtml5Supported = true,
TextInfo = {FontName = "Arial Unicode MS"},
IfHtmlTagSupportedOverwriteHtmlFontNames = true
};
text.TextInfo.IsFontEmbedded = true;
section.Paragraphs.Add(text);
pdf.Save(pdfOutputPath);
MHTML to PDF:using (var document = new Document(mhtmlFile, new MhtLoadOptions()) { PageInfo = { Margin = new Aspose.Pdf.MarginInfo(25, 20, 25, 25) } })
{
document.Save(pdfOutputPath, SaveFormat.Pdf);
}
Note: I couldn't find any way to add Unicode support for the 'Aspose.Pdf.Document.Document' class. Should it be auto-detected or is it missing?How shoud I extract table Data from PDF files using Aspose PDF
Apply rotation on existing content
Aspose.PDF for Cloud confuses two separate characters with one single character
Abort PDF Save thread
aspose.pdf.document to aspose.words.document
How can I do this the easy way?
Error converting PDF to PDF/A-1b
Hello,
Please try to convert attached document to PDF/A-1b
Conversion fails with exception.
An unhandled exception of type 'System.InvalidCastException' occurred in Aspose.Pdf.dll
Additional information: Unable to cast object of type ' . ' to type ' . '.
Reproduced with Aspose.PDF 10.9.0.0.
Thanks in advance for your help,
Liza
Background Image CSS Property
Refer to the attachment (html snippet as well as the image used).
1. HTML displays content inside the shape "circle.png" on browser.
2. When we try to use Aspose, the shape does not show up.
3. If I change the background-size to Cover, it tries to draw the image and does not fit the box.
My concern is around:
background-image: http://localhost/GEMSUI/Images/Charting/circle.png") !important; background-repeat: no-repeat; background-size: 100% 100%;
In Browser the image will scale to DIV size but in html it does not.
If I use background-size: cover; it gives partial image.
PDF Concatenate not working
JPEG 2000 to PDF
Pdf to Word conversion - Hebrew
Bug Report: PDF Text extraction takes several minutes, with 100% CPU
On some of our machines, the text extraction for a small document takes several minutes, with 100% CPU and locking other threads, whereas it is very fast on others. The reason is simple: Aspose.pdf looks for font directories in a given list. The list is the following:
"%WINDIR%/Fonts/",
"/usr/openwin/lib/X11/fonts/TrueType/",
"/usr/local/share/fonts/",
"$home/.fonts/",
"/usr/share/fonts/truetype/",
"/usr/X11R6/lib/X11/fonts/ttfonts/",
"/Library/Fonts/",
"~/Library/Fonts/",
"/Network/Library/Fonts/",
"/System/Library/Fonts/",
"~/.fonts/",
"/usr/share/fonts/",
"/usr/share/X11/fonts/TTF/",
"/system/fonts/"
But, if none of these directories exist (this is disturb-dependent), then the fallback becomes "/" ! As a result, one thread scans the full hard-drive, locking all the other...
This results in a several minutes 100% CPU activity, but everything locked.
The workaround is simple, create an empty ".fonts" directory in the home dir of the user executing the application. But I clearly think this should be considered as a bug !
Remove existing PDF security restrictions
owner password: yesuser password: noopen: allowedprinting: not alloweddocument assembly: not allowedpage extraction: not allowed
printing: alloweddocument assembly: allowedpage extraction: allowed
printing: alloweddocument assembly: not allowedpage extraction: allowed
How do I remove the restriction on document assembly?
Not all Adobe fields are extracted in Form Fields
Environment: Libraries 10.3 and 10.9.0 (release Oct 2,2015)
I want to extract Adobe form fields and noticed that out of 68, only 35 are extracted. Why is that the case? How can I extract all 68 of them?
I attached document reg135.pdf as a use case.
I use the following code to extract location coordinates of the form fields:
//Step 1: Get all Adobe fields.
Aspose.Pdf.Facades.Form form = new Aspose.Pdf.Facades.Form(filename);
Aspose.Pdf.Facades.FormFieldFacade fieldfacade = null;
string field_value = null;
//get all field names
String[] allfields = form.FieldNames;
Aspose.Pdf.PageCollection pageCollection = pdfDocument.Pages;
foreach (string mFieldName in allfields)
{
try
{
fieldfacade = form.GetFieldFacade(mFieldName);
field_value = form.GetField(mFieldName);
Aspose.Pdf.Page pdfPage = pageCollection[textFragment.Page.Number];
if (String.IsNullOrEmpty(field_value)){
//Break it down & form the json data
System.Drawing.Rectangle box = fieldfacade.Box;
dynamic adobe_ft = new System.Dynamic.ExpandoObject();
adobe_ft.page_number = fieldfacade.PageNumber - 1;
adobe_ft.required = form.IsRequiredField(mFieldName);
adobe_ft.x = box.X;
adobe_ft.label = mFieldName;
adobe_ft.y = pdfPage.MediaBox.Height - box.Y - box.Height;
adobe_ft.width = box.Width;
adobe_ft.height = box.Height;
mAdobeDefinedfields.Add(adobe_ft);
fieldfacade.Reset();// resets all visual attributes to empty value.
}
} catch(Exception e){
if (e.Message.Contains("cannot"))
{
// Trace.WriteLine("---- Field cannot be found: "+mFieldName);
}
}
Questions:
1. How can I get all 68 form fields with the code given above? Can you please suggest a solution? Or let me know if this is a bug?
2. This is follow up for another issue: http://www.aspose.com/community/forums/permalink/660958/660958/showthread.aspx#660958 and you've logged a ticket for it: PDFNEWNET-39486 to correct the height values of form fields extracted. When is the fix for this expected?
Thank you,
Sireesha
HTML to PDF conversion
XML file with Unicode Characters are not visible on pdf
Conversion PDF to DOC is not correct
Issues with PDFFileInfo in checking Encrypted, password Protected Files
Hi,
I am using the below code for checking encrypted and password protected files. For encrypted files isPDFFile always return fals and isEncrypted throws an error:
PdfFileInfo is not initialized. Use constructors with parameters or properties for initialization.
It always sets tru for hasOpenPassword no matter what and always throws an invalid passwordexception for editPassword even if it the one of the region of the files are protected.
Is there a way to capture all these information for a pdf file.
if(fileInfo.isPdfFile()){
metaData.setMimeType(PDFMetadata.MIME_TYPE_PDF);
}
//File is Password protected for opening.
if(fileInfo.hasOpenPassword()){
metaData.setPasswordProtected(true);
}
//File is Password Protected for Editing.
if(fileInfo.hasEditPassword()){
metaData.setSecure(true);
}
//File is encrypted.
if(fileInfo.isEncrypted()){
metaData.setEncrypted(true);
}
Regards,