Add Image in PDF with Alive PDF

Hi community, i need help to add a image in PDF with Alive PDF.
I try it so:
[Embed(source="bilder/PDFLogo.png", mimeType="application/octet-stream" )]
protected var PDFLogos:Class;
printPDF.addImageStream(new PDFLogos() as ByteArray,15,5,190,0);
But they gives me an error when i compiling.
When i try it so
printPDF.addImageStream(new PDFLogos() as ByteArray,ColorSpace.DEVICE_RGB)
then i can compile but when i click on the button then can´t download the pdf please help

Hi Kamil,
Hello, I attached a piece of code we use, including statements, etc.. In my case, I captured all the content is a canvas to create a report of a bar chart or pie chart.
     import org.alivepdf.display.*;
     import org.alivepdf.fonts.*;
     import org.alivepdf.layout.*;
     import org.alivepdf.pdf.*;
     import org.alivepdf.saving.*;
protected var pdf:PDF;
// declared of logo or imagen on top of the PDF's document.
[Embed(source="assets/logo.jpg", mimeType="application/octet-stream" )]
protected var jpgBytes:Class;
protected function savePDF(event:MouseEvent): void {
        pdf = new PDF(Orientation.LANDSCAPE, Unit.MM, Size.LETTER);
        pdf.setDisplayMode(Display.FULL_WIDTH);
        pdf.addPage();
        pdf.addImageStream(new jpgBytes() as ByteArray, 10, 10, 0, 0, 1);
        pdf.setFont(FontFamily.ARIAL, Style.NORMAL, 12);
        pdf.addText("Grafico de Rata de Fallas", 100, 40); // title
        pdf.addImage(imprimirRata, 50, 50, 200, 150); // captured canvas with charts
//      pdf.addImage(leyendaImprimir, 50, 120, 20,20); // captured leyend of charts
        pdf.addText("RTP Software. Modulo de Score Card.", 10, 200); // header of the document
        pdf.addText("Creado: " + new Date(), 180, 200); // Add the created date as a leyend or footer on document
        var fs:FileStream = new FileStream();
        var file: File = File.desktopDirectory.resolvePath("rtp-ratadefallas.pdf"); // Name of the file
        fs.open(file, FileMode.WRITE);
        fs.writeBytes(pdf.save(Method.LOCAL));
        fs.close();
        Alert.show("El reporte ha sido generado", "Informacion"); // Confirmation message as a pop-up
 

Similar Messages

  • How do I compress a pdf with Create PDF so that I can attach it to e-mail?

    How do I compress a pdf with Create PDR so that I can attach it to e-mail?

    Hi, Blue Mamba.
    Your file is automatically compressed when using the CreatePDF service to convert from some other file type (e.g. Word, Excel) to PDF. For example, most PowerPoint files get compressed 50% to 90% over their original size.
    If there is a particular file you're converting to PDF using the CreatePDF service, and you are not seeing the size savings that you would like, please provide more details.
    Thanks.
    Dave

  • Exporting PDF with standard PDF/X-1b

    Hello All,
    We received the request from one of our client to generate the PDF with the standard 'PDF/X-1b', but while exporting the PDF from InDesign, we don't have this option, could you please check and advise how to meet this requirement?
    Thanks in advance,
    Praveen

    You should ensure that 1b is meant. I suppose it is a typo.
    If your client requires a CMYK, then 1a would be the correct version.
    You could ask for a joboption file. You can install it, open Acrobat Distiller and drag and drop the joboption file into the open Distiller window. This will install this joboptions for all programs with PDF export like InDesign too.

  • Cannot export to PDF with grayscale PDF in layout

    IDCS5.5, MacPro, OSX 10.7.4
    I am working on a grayscale teacher’s guide that accompanies a CMYK schoolbook. The introduction pages contain miniature pages of the workbook (formatted as grayscale PDF), but InDesign refuses to output those pages as PDF ("Impossible d’exporter le fichier PDF"), or when it does produce a PDF (when exporting page by page), Acrobat warns of a possible problem and stuff is missing on the resulting page, not necessarily from the grayscale minipages.
    I have tried grayscale PDFs created from the original CMYK PDFs in Acrobat Pro X, grayscale PDFs exported from the original CMYK file in InDesign CS6, PDFs reduced to 20% in InDesign, PDFs reduced to 20% with a third-party application and imported in ID at 100%, and all sort of variations on the export values. The problem is also present in InDesign CS4 (after exporting the file as IDML) and in CS6.
    The thing is, there is no problem at all if I use the CMYK PDF version of the minipages (I then turned the resulting PDF into grayscale with Acrobat Pro X). But the printer expects to see only grayscale images in a grayscale job, not color... and a Photoshop version of those minipages is not acceptable.
    Has anybody encountered that problem? Can you reproduce it, i.e. can you export to PDF if you use any type of grayscale PDFs in your layout?

    FOUND IT! Inspired by Rob solution, I was able to export my InDesign CS5.5 document containing some grayscale PDFs to PDF/X-3:2002 (and PDF/X-1a:2001), with or without the standard, but without converting to destination. For some reason, it does not work with PDF/X-4:2008, nor with any of the other presets.
    -3

  • Acrobat 9 Pro - Will it print to pdf with embedded pdf's from Word 2007?

    Hello All,
    We're considering upgrading to Acrobat 9 Pro or Extended.  One of our concerns is whether it will handle the following:
    1. We create very large documents and we like the ability to use OLE of existing PDF documents imbedded into Word 2007 which causes a new PDF window  to open up from the imbedded PDF.  It also displays nicely as an icon or the cover page within Word.
    2. The challenge is when printing (distilling) that master document with any imbedded PDFs, the icon or cover page is displayed, but the OLE feature goes away and does not recognize the imbedded PDF any longer; Acrobat simply treats the imbedded PDF in Word as any other page in the distilling process.
    3. We're not wild about bookmarking or linking to another PDF.
    Does Acrobat 9 Pro or Extended resolve this issue?

    The options availible for scripted print settings are all shown in the entry for "PrintParams" object in the Acrobat JavaScript Reference.  Have you looked to see if these options fit your needs?  If they do, and if the script can detect which PDF requires which options, then  you're in business.  But if the options you need are not there, then your only option is to set the batch process to display the print dialog for every PDF.
    Thom Parker
    The source for PDF Scripting Info
    pdfscripting.com
    The Acrobat JavaScript Reference, Use it Early and Often
    http://www.adobe.com/devnet/acrobat/javascript.html
    Then most important JavaScript Development tool in Acrobat
    The Console Window (Video tutorial)
    The Console Window(article)

  • Openeing a pdf with native pdf reader: openwithdefaultapplication

    Hello,
    Wondering if anyone can help on this one. From what I have read AIR for android does not support openwithdefaultapplication. The device I am developing for , the Motorola Xoom does not support pdf viewing in StageWebView or the browser. I have tried stagewebview and navigatetourl witn no success. So is it possible to open my pdf's with the native pdf viewer, calling it from my flex mobile app, developed in FB4.5 Any tips/ links sample code on how to do this, if it is possible would be great.
    Thanks

    Just to let everyone know. The answer
    Rangora gave was the correct solution for my purposes. I actually found this link (below) a while ago which takes you through it and gave me some inspiration. Its a java hack and not the prettiest solution. Lets hope Adobe and Android provide something a little more useful in the future
    http://www.jamesward.com/2011/05/11/extending-air-for-android/
    This (above) is if you want to open local files with the native/default application. I actually managed to extend this and get it to open a file with its default application (not just pdfs, any type as long as the tablet has a software that can open/support the type)
    For the unitiated who have found this post: WebView is only good for loading webpages and pdfs wont load on HoneyComb devices this way. You can get PDFs to display in a browser with PDF plugin on Honeycomb devices, but only from a hosted file location (webserver) which wasnt any good for my purposes
    The link above is currently the only way to open local files with their default application
    Thanks to all for your participation

  • Help converting html/xhtml to pdf with bfo pdf lib or other tools?

    Hi,
    I need to convert from xhtml to pdf. I tried parsing it with xerces and crimson but wouldnt work. So the samples coming with big faceless pdf library dosent work. Is there any other method to convert html/xhtml to pdf - any libraries for direct conversion. BFO pdf report generator takes xml as i/p to convert to pdf.
    Thanks for any help

    Look here:
    http://www.adobe.com/sea/products/server/pdfgenerator/

  • Can I "Print to PDF" with Adobe PDF Pack?

    ONe of the reasons I purchased PDF pack is because it says that I can "print to PDF" which is said to mean that when I go to print something that one of my choices of printer besides my HP should be Adobe. I don't see anything in my drop down of printers that wasn't there before I purchased the PDF PACK. I have rebooted and everything and still nothing is there. Can you help?

    Hi geolog12 and remedy111,
    If you're on Windows, you can use the CreatePDF Desktop Printer to "print" to PDF from almost any application. You'll find a link to the installer on the Create PDF page when you're logged in to the PDF Pack account.
    Here are the instructions for installing it: http://helpx.adobe.com/acrobat-com/kb/using-pdfpack.html#main_adobePDF_desktop_printer
    Best,
    Sara

  • Can i optimize a pdf with the pdf pack?

    hi! I've been using acrobat pro in order to benefit from the optimization feature which helps reduce the weight of the files in order to mail them. I was wondering if the pdf pack which has a much lower cost offers this feature. Thank you very much. Alfonso

    No, PDF optimization is only available on Acrobat Pro.

  • Resizing PDFs with Adobe PDF Pack

    Our office uses Adobe PDF Pack for combining PDFs and conversions. However, when we send reports via email our PDF attachments are too large for the email to be sent.  Is there a way to resize the file using Adobe PDF Pack, or do we need to buy Adobe Acrobat (I know using Adobe Acrobat to resize you do the PDF Optimizer)?
    Thank you in advance.

    Yes, you'll need Acrobat Pro. (which has the optimizer) to reduce the file size of a PDF.

  • Try Alive PDF, it's awsome

    Hey guys,
    I just try <a href="http://www.alivepdf.org/">Alive PDF</a> a great Action Script 3 library.
    With that you can easily build pdf form, on top of a flex application.
    I did a test case in BSP and it worked greeat (if anyone is interested i'll try to blog it )
    Good bye ADS, Smartforms, SAPscript
    Long live Alive PDF
    great sunday to everyone
    Quentin

    Sorry i haven't gotten so much time to blog. I'm building a library on top of alivePDF in order to make it easier.
    But here is the BSP page to use in order to generate the PDF with alive pdf :
    EventHanfler onInitialisation :
    DATA w_xstring TYPE xstring.
    DATA: cached_response TYPE REF TO if_http_response.
    DATA: display_url TYPE string .
    DATA: guid TYPE guid_32.
    w_xstring = request->get_data( ) .
    CREATE OBJECT cached_response
      TYPE
        cl_http_response
      EXPORTING
        add_c_msg        = 1.
    cached_response->set_data( w_xstring  ).
    cached_response->set_header_field( name = if_http_header_fields=>content_type
    value = 'application/pdf' ).
    cached_response->set_status( code = 200 reason = 'OK' ).
    cached_response->server_cache_expire_rel( expires_rel = 180 ).
    CALL FUNCTION 'GUID_CREATE'
      IMPORTING
        ev_guid_32 = guid.
    CONCATENATE runtime->application_url '/' name INTO display_url.
    cl_http_server=>server_cache_upload( url = display_url response = cached_response ).
    navigation->goto_page( display_url ).
    I'll post something about it soon
    good day
    Quentin

  • Problem with Copying PDFs to any application other than iBooks

    OK here is my problem,
    I used to be able to associated PDFs with other PDF readers (via iTunes > APPS > File Sharing). I just dragged and dropped and all was right in my world. However, all of a sudden this stopped working. I have no clue as to what caused this problem to arise. The only thing I remember 'doing' was adding some new apps.
    I cannot use the PDFs through iBook, well I can but it doesn't meet my needs (highlighting, copying and pasting and adding notes). So instead I want to use PDF HD. I used to have on PDF Masker and Good Reader, but neither does what I want.
    Suggestions?

    Hello Sin K,
    so proxy and Tomcat are located on different machines as well? Is the proxy able to commuicate with the Tomcat on the configured internal ports and is the proxy able to lookup the hostname you configured for the Tomcat?
    For the connector, the proxyName and proxyPort should be the parameters the client uses to call APEX. So if your clients should call via http://proxyserver:8080/testsin/apex the settings would be
    proxyName=proxyserver
    proxyPort=8080Reason for this is that applications (e.g. the APEX Listener) generate there URL references with these parameters.
    But does your proxy actually serve on port 8080? And is that port accessible by clients? Do clients accept cookies from that server?
    In my case, there is only one 302 which redirects to http://host:port/apex/f?p=4500:1000:sessionid which is correct.
    If you look into your first post request in firebug, what's in the request header?
    -Udo

  • How [Insert|Add] Image into Opening PDF file with Acrobat SDK.

    Hi Guys,
    I'm trying to insert|add image file into opening PDF file with specified location (X|Y) and scale (Width|Hight) but got many of troubles
    If use third party like iTextSharp or something else thing become simple but i want to use Acrobat SDK to do this
    Any suggestion or idea?
    Any help appreciated.

    Thank for your interested.
    I use VB.NET and Acrobat
    Here is some my code:
    Try
       If File.Exists(T(0)) Then
       Dim AcroAVDoc As AcroAVDoc = Ap.GetActiveDoc
       Dim AcroPDDoc As AcroPDDoc = AcroAVDoc.GetPDDoc
       Dim AcroPDPage As Acrobat.AcroPDPage = AcroPDDoc.AcquirePage(Integer.Parse(T(3)))
       Dim data() As String = T(1).Split("^")
       Dim imgX = data(0)
       Dim imgY = data(1)
       Dim imgWidth = data(3)
       Dim imgHight = data(4)
       'TODO: insert into opening PDF file
       Return 1
       End If
       Catch ex As Exception
       End Try
    I don not know what to do next to insert an image (JPEG, PNG, ..) into PDF file.
    Can you show me or suggest some solution, idea?
    Thank in advance.

  • How to add Images and PDFs in MDM iView

    Hello!
    We use SAP Portal as interfase to access SAP MDM repository tables.We use MDM Record Set and MDM Item Detail iViews to display and operate with main table content.
    There is a field in the qualified table, which is the lookup to the Images table. And the other field is the lookup to the PDFs table. Both fields are qualifiers.
    In the main table there is a field, which is the lookup to the qualified table. When we try to add values to this field using Item Detail iView, we get a window, where we can fill all values of the qualified table, except Image field and PDF field - they are disabled. So, can we add Images and PDFs to the table using Item Datail iView? Or what is the other way to add them?
    Thanks,
    Vika
    Message was edited by:
            Viktoria Demina

    Ooohh... you mean, like the one mentioned in http://indesignsecrets.com/adding-zoom-and-print-to-indesign-swf-files.php?
    But they want to get paid for their hard work, the bastards!

  • How do i add images in the header and footer to a PDF using iText

    Hi ,
    I want to add images to the header and footer of every page while i am genrating a pdf i have created a separate class called EndPage which i am instanceiating its default constructor in another class 's button action method.
    The above code genrates a PDF for me however it genrates a file with file size zero bytes and does not open it following is my sample code
    //**********Any Help would be appreciated
    Thank You
    public class My_Class
    public String pdf_action()
    EndPage ep=new EndPage();
    return null;
    }//My_class Ends
    class EndPage extends PdfPageEventHelper
    * Demonstrates the use of PageEvents.
    * @param args no arguments needed
    public EndPage()
    try {
    com.lowagie.text.Document document = new Document(PageSize.A4, 50, 50, 70, 70);
    PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream("D://proposals/endpage.pdf"));
    writer.setPageEvent(new EndPage());
    document.open();
    String text = "Lots of text. ";
    for (int k = 0; k < 10; ++k)
    text += text;
    document.add(new Paragraph(text));
    document.close();
    catch (Exception de) {
    de.printStackTrace();
    public void onEndPage(PdfWriter writer, Document document) {
    try {
    Rectangle page = document.getPageSize();
    PdfPTable head = new PdfPTable(3);
    for (int k = 1; k <= 6; ++k)
    head.addCell("head " + k);
    head.setTotalWidth(page.width() - document.leftMargin() - document.rightMargin());
    head.writeSelectedRows(0, -1, document.leftMargin(), page.height() - document.topMargin() + head.getTotalHeight(),
    writer.getDirectContent());
    PdfPTable foot = new PdfPTable(3);
    for (int k = 1; k <= 6; ++k)
    foot.addCell("foot " + k);
    foot.setTotalWidth(page.width() - document.leftMargin() - document.rightMargin());
    foot.writeSelectedRows(0, -1, document.leftMargin(), document.bottomMargin(),
    writer.getDirectContent());
    catch (Exception e) {
    throw new ExceptionConverter(e);
    }

    Hi,
    Thanks for the quick response.
    The problem is that when I keep the logo as a watermark, the pdf is not adjusting itself to include the logo as header.
    But if I add a header text via Tools -> Headers and Footers, the pdf is adjusting itself so that the header text is at the beginning , not overlapping with the contents of pdf.
    But while using logo as watermark, some times overlapping of the pdf contents and logo is happening.
    Is there any way to add a logo in the Header and Footer via the option in Tools -> Headers and Footers
    Thanks,
    Vidhya

Maybe you are looking for

  • How to register External Adaptor Engine in SAP PI 7.0?

    Hi,    I am Sreeramulu Konjeti, I installed PI 7.0 as standard alone system.But Adapter engine is not working, thats why i installed Adapter Engine separately...even I registered Adapter Engine in SLD...But i am un able to see that Adaptor Engine in

  • Oracle direct path read IO size

    Hello! I am confused a little with IO size. I am running 11.2.0.3 on Oracle Linux x64 6.2. Block_size=8K, MULTIBOCK_READ_COUNT=128 Database is Single Instance and is using ASM grid. ASM AU =1M As a test I am running a simple query against large table

  • Soap sender communication channel is not shown in RWB

    Dear Experts, We had a recent installation of Xi and after that i m attemting a Soap to rfc syn scenario and i have created both the soap and rfc communication channel on a abap business system. and now im not able to see the Soap communication chann

  • Reason for getting USB_STALL_ERROR for an Ipod command in Windows CE system

    We are getting USBSTALLERROR while sending the iPod command in the Apple Accessory Protocol format using the Function as shown below in a Windows CE System. USBDEVICEREQUEST ControlHeader; ControlHeader.bmRequestType = USBREQUEST_HOST_TODEVICE | USBR

  • Quicktime crashes when opening any video file type.

    Hi, I've been having this problem for quite a long time now. When attempting to open a quicktime file or any other type of video file, the program crashes. It does not report any sort of error message. I've updated both quicktime and windows. I've tr