Quantcast
Channel: Aspose.Pdf Product Family
Viewing all 3131 articles
Browse latest View live

Problem with text to pdf conversion - missing fonts

$
0
0
Hi,

    We have a problem converting text to PDF. We read text from file uploaded to server, and add id to PDF. When we call save operation on PDF object an exception is thrown:

java.lang.IllegalStateException: The TruetypeFontFileName should be specified when using unicode.

When we specify font and font name we get"
java.lang.IllegalStateException: Font 'Arial' not found. Please make sure the customer font file is correctly set.

Our code:
FileInputStream fstream = null;
BufferedReader br = null;
try {
Pdf pdf = new Pdf();
Section sec = pdf1.getSections().add();
TextInfo tInfo = sec1.getTextInfo();
tInfo.setFontName("Arial");
tInfo.setTruetypeFontFileName("/usr/share/fonts/msttcore/arial.ttf");
sec.setTextInfo(tInfo);
fstream = new FileInputStream(getRealFilePath(path));
br = new BufferedReader(new InputStreamReader(fstream));
String line;
while ((line= br.readLine()) != null) {
// Create a new text paragraph and pass the text to its
// constructor as argument
Text text= new Text(sec, line);
text.getTextInfo().setFontName("Arial");
text.getTextInfo().setTruetypeFontFileName("/usr/share/fonts/msttcore/arial.ttf");
text.setUseTextInfoStyle(true);
sec.getParagraphs().add(text);
}
String realPathFile = getRealFilePath(renderPath(uuid));
pdf.getTextInfo().setFontName("Arial");
pdf.getTextInfo().setTruetypeFontFileName("/usr/share/fonts/msttcore/arial.ttf");
pdf.setUnicode();
pdf.save(realPathFile);

} catch (IOException e) {
logger.info(e.getMessage(), e);
} catch (Exception e) {
logger.info(e.getMessage(), e);
} finally {
if (in != null) {
try {
in.close();
} catch (IOException e) {
logger.error("error while closing stream ", e);
}
}
}

What should we to to be able to create PDF file from text ?

Kind Regards,
Maciej Jaźwiński

Text extraction from specified placed from pdf into fields of sql server table

$
0
0
Hi Friends

Please see the attached file. i have to write the code using your aspose pdf to import the selected data into corresponding fields in sql server tables.

The report has general comments ( written in blue) and observations ( negative comments written in Red with a prefix "Inspector Observations:" Only these observations ( highlighted in red) are to be recorded along with the response.   

Wherever there is an observation : 

 

- On the Right side the answer would be 'N' (otherwise it is 'Y')

- the term "" Inspector Observations" will be written in addition to the Red colour.  

This report may contain several comments having answers N . so i have to capture and load them into corresponding fields of an Sqlserver  table.

Please suggest me a solution.

we will purchase your Aspose pdf if it is suitable to help in this development process.

eagerly waiting for your response.

Regards
Ghazi Anwar

Embedded file compression

$
0
0
Is there anyway to disable file compression when adding an embedded file?

Aspose Total : Aspose PDF - sync up the javadoc and the library

$
0
0
I downloaded the latest aspose total for java distributable. I used the aspose.pdf library. When I looked at the javadoc,I see the class MemStream but pdf library does not have the MemStream class ...Can you please sync up the javadoc and the library ? and let me know.

AsposePDF 8.5 not printing the correct size.

$
0
0

Dear Aspose,

I am having difficulties printing a PDF in its true size. I am working on 2008 server, with aspose 8.5. See the attachments for PDF and my code.

No matter what i try (margins to 0, printasimage, autoscale on/off, other printer...), PDF's are always printed about 50-75% smaller than when printed with a pdfreader.

Could you please advise me?

Regards,


Nathan Moerman

 

PDF to PDF/A format

$
0
0

Hi Please let me know whether there is any update on PDF to PDF/A format convertion.

 

Thanks

Attached document does not raise "Invalid Password" when Document object is constructed

$
0
0
With the attached document, if I run the following code:
            
            string filePath = @"[PATH]\test.pdf";
            Aspose.Pdf.Document doc = new Aspose.Pdf.Document(filePath);

no "Invalid password" exception is raised. However, if I open this file in Adobe Acrobat or Reader I am prompted with an Open password.

How shoud I extract table Data from PDF files using Aspose PDF

$
0
0
Hi All,

I would like to extract table data from PDF files.  Do you know which method I should use in order to extract table data from PDF?

Thanks in Advance.

Min

aspose.pdf or com.aspose.pdf

$
0
0
Hi ,

I see in the documentation "aspose.pdf(legacy)". Is aspose.pdf a legacy library and we are not supposed to use it ? Is it replaced by "com.aspose.pdf" ?

I see lot of classes may be refactored in com.aspose.pdf with the same behaviour .Are we supposed to use "com.aspose.pdf"  ? Can you please detail what are these two groups and when to use which ?

Praveen

Problems with the page size

$
0
0

Hi,

If I want to create a final PDF file from multiple PDF files, the page dimensions are set incorrectly. Page 1 is correct, but unfortunately the following page sizes do not change. Please make sure that the following pages can be of a different size. Or there is another possibility that I've forgotten? I’ve attached the sample files to this post.

The Code I used is as followed:

//create two file streams to read pdf files
FileStream fs1 = new FileStream(@"d:\test\first.pdf", FileMode.Open, FileAccess.Read);
FileStream fs2 = new FileStream(@"d:\test\second.pdf", FileMode.Open, FileAccess.Read);

var pfe = new Aspose.Pdf.Facades.PdfFileEditor();
Stream stream1 = fs1;
Stream stream2 = fs2;
//Stream stream3 = new FileStream("input3.pdf", FileMode.Open, FileAccess.Read);
Stream output = new FileStream(@"d:\test\output.pdf", FileMode.Create, FileAccess.Write);

pfe.MakeNUp(new[] { stream1, stream2 }, output, true);


Kind regards
Sebastian

Minimum row height that can be set for a row in a table

$
0
0
Hi,

Can you please let us know what is the minimum row height that can be set for a row in a table ?

What does this minimum value depend on ?

When I created a new pdf with a table and when I set a row height below 20 ,there is no change when the table is rendered on the pdf document. (This was done with Aspose.pdf 4.2). Is there any restriction on the minimum row height ?

Praveen


Default header and footer for pages in com.aspose.pdf

$
0
0
Hi

Can you please let us know how to set default header and footer for all the pages of the document using com.aspose.pdf api

Regards
Praveen

Getting DataMatrix Barcode from image results in "java.lang.NoClassDefFoundError: com/sun/servicetag/UnauthorizedAccessException"

$
0
0
Hi,

it seems that detecting DataMatrix barcode from an image results in an exception:

Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/servicetag/UnauthorizedAccessException
    at com.aspose.internal.barcode.D.a.a(Unknown Source)
    at com.aspose.internal.barcode.D.a.a(Unknown Source)
    at com.aspose.internal.barcode.D.a.a(Unknown Source)
    at com.aspose.internal.barcode.D.d.a(Unknown Source)
    at com.aspose.internal.barcode.D.d.a(Unknown Source)
    at com.aspose.internal.barcode.D.d.a(Unknown Source)
    at com.aspose.internal.barcode.D.d.a(Unknown Source)
    at com.aspose.internal.barcode.W.L.c(Unknown Source)
    at com.aspose.internal.barcode.W.L.a(Unknown Source)
    at com.aspose.internal.barcode.W.ac.a(Unknown Source)
    at com.aspose.barcoderecognition.c.D(Unknown Source)
    at com.aspose.barcoderecognition.c.j(Unknown Source)
    at com.aspose.barcoderecognition.BarCodeReader.read(Unknown Source)

Here is my code for reproducing the problem. What is to do?
  1. Update static member IMAGE_OK, IMAGE_FAIL and LICFILEPATH  in TestAsposeBarcode.java
  2. Start TestAsposeBarcode.java
Result:
  • Barcode in IMAGE_OK will be detected
  • Barcode in IMAGE_FAIL will fail with exception

Thanks a lot
Best regards
Matthias

postscript to pdf conversion

$
0
0

Is there an update on issue PDFNEWNET-20110.  The last update I saw was 2010.  I need to convert .ps files to pdf.

 

Thanks!

System.IO.IOException: Read pdf error:Trailer object is null.: v4.6.0.0

$
0
0
Creating a PDF, I have a function that Adds a Footer below, at the bolded line, I am getting the error:
System.IO.IOException: Read pdf error:Trailer object is null.: v4.6.0.0

Any ideas what can be causing this?  Very time sensitive issue as this is on our production server.  Thank you.

Public Sub AddFooter(ByVal strFileIn As FileStream)
        Dim strFileOut As FileStream = strFileIn ' Output file can't be nothing, so I assign it a value to be overwritten.

        Dim txt As New FormattedText()

        'TODO: If possible, replace text with image to get the superscript "SM" in place.
        ' Footer FormattedText Object
        Dim ft As New FormattedText("AgendaManager – Powered by the CAIU", _
                                    System.Drawing.Color.FromArgb(255, 207, 207, 207), _
                                    Kit.FontStyle.HelveticaBold, _
                                    EncodingType.Winansi, _
                                    True, _
                                    10)

        ' PdfFileStamp type object
        Dim filestamp As New PdfFileStamp(strFileIn, strFileOut)

        filestamp.AddFooter(ft, 44, 0, 72)

        filestamp.Close()
        strFileIn.Close()
        strFileOut.Close()

    End Sub

Create PDF viewer using Aspose PDF

$
0
0
Is it possible to create PDF viewer in Winform using Aspose PDF?

problem converting pcl files to pdf

$
0
0

I am trying to convert pcl files into a searchable pdf. 

The app running on winXP and using HP PCL5 print driver produces an ascii encoded pcl.  When I convert it using aspose it works well.

 

The app running on win7 and using HP PCL5 print driver produces UTF8 encoded pcl and aspose errors out on the conversion with many errors errors like:

Font: MS PCLXLFont 002 is not installed.

Substituting font: BC C128 HD wide

It creates a pdf file but it is empty.

File versions are:

aspose.pdf.dll      file version  7.6.0.0
aspose.pdf.kit.dll  file version  5.5.0.0

 

I have attached a zip file with examples.  Files generated on xp have "xp" in the file name and same with win7.

 

Thank you!

 

 

How do i convert an acsm to pdf?...

$
0
0
How do i convert an acsm to pdf? any advice will be appreciated!!!
......

Error:java.lang.NoClassDefFoundError: com.aspose.pdf.Document

$
0
0
Use Aspose.Pdf for Android Examples Repository 
adding aspose-pdf-android-1.2.0.jar to HelloWorld project.

java error code:
01-26 11:52:54.915: E/AndroidRuntime(3007): FATAL EXCEPTION: main
01-26 11:52:54.915: E/AndroidRuntime(3007): java.lang.NoClassDefFoundError: com.aspose.pdf.Document
01-26 11:52:54.915: E/AndroidRuntime(3007): at com.aspose.pdf.android.example.helloworld.MainActivity.HelloWorld(MainActivity.java:17)
01-26 11:52:54.915: E/AndroidRuntime(3007): at com.aspose.pdf.android.example.helloworld.MainActivity.onCreate(MainActivity.java:48)
01-26 11:52:54.915: E/AndroidRuntime(3007): at android.app.Activity.performCreate(Activity.java:5122)
01-26 11:52:54.915: E/AndroidRuntime(3007): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1081)
01-26 11:52:54.915: E/AndroidRuntime(3007): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2270)
01-26 11:52:54.915: E/AndroidRuntime(3007): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2358)
01-26 11:52:54.915: E/AndroidRuntime(3007): at android.app.ActivityThread.access$600(ActivityThread.java:156)
01-26 11:52:54.915: E/AndroidRuntime(3007): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1340)
01-26 11:52:54.915: E/AndroidRuntime(3007): at android.os.Handler.dispatchMessage(Handler.java:99)
01-26 11:52:54.915: E/AndroidRuntime(3007): at android.os.Looper.loop(Looper.java:153)
01-26 11:52:54.915: E/AndroidRuntime(3007): at android.app.ActivityThread.main(ActivityThread.java:5297)
01-26 11:52:54.915: E/AndroidRuntime(3007): at java.lang.reflect.Method.invokeNative(Native Method)
01-26 11:52:54.915: E/AndroidRuntime(3007): at java.lang.reflect.Method.invoke(Method.java:511)
01-26 11:52:54.915: E/AndroidRuntime(3007): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833)
01-26 11:52:54.915: E/AndroidRuntime(3007): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
01-26 11:52:54.915: E/AndroidRuntime(3007): at dalvik.system.NativeStart.main(Native Method)

converting hebrew website url to PDF

$
0
0
Hi

I'm trying to convert a single page in my website into PDF,
my website is written with hebrew fonts,
the PDF which was created with ASPOSE.PDF contains reversed hebrew strings.

URL for an example:

https://businessinfo.leumi-card.co.il/NotRegistered/Login/BusinessLogin.aspx

PDF which was created is attached to this Message.

i'm using this code to generate this:

     WebClient client =newWebClient();

           Console.WriteLine("loading url");

           Stream stream = client.OpenRead(@"https://businessinfo.leumi-card.co.il/NotRegistered/Login/BusinessLogin.aspx");

           StreamReader sr =newStreamReader(stream);

           string str= sr.ReadToEnd();

            Aspose.Pdf.Generator.Pdf pdf =new Aspose.Pdf.Generator.Pdf();

            Aspose.Pdf.Generator.Section section = pdf.Sections.Add();

           //pdf.IsRightToLeft = true;

           //pdf.IsRtlInSegmentMode = true;

            Aspose.Pdf.Generator.Text text =new Aspose.Pdf.Generator.Text(section, str);

            text.IsHtmlTagSupported=true;

            text.TextInfo.IsUnicode =true;

            text.TextInfo.FontName ="Arial Unicode MS";

            section.Paragraphs.Add(text);

            pdf.HtmlInfo.ImgUrl =@"https://businessinfo.leumi-card.co.il";

            Console.WriteLine("saving pdf");

            pdf.Save(@"c:\guy.pdf");


best regards,
guy bertental
Viewing all 3131 articles
Browse latest View live