Package com.lowagie.text

Examples of com.lowagie.text.DocumentException


     * @see RtfParser#importRtfFragment(InputStream, RtfDocument, RtfImportMappings)
     * @since 2.0.8
     */
    public void importRtfFragment(InputStream documentSource, RtfImportMappings mappings, EventListener[] events ) throws IOException, DocumentException {
        if(!this.open) {
            throw new DocumentException(MessageLocalization.getComposedMessage("the.document.must.be.open.to.import.rtf.fragments"));
        }
      RtfParser rtfImport = new RtfParser(this.document);
      if(events != null) {
        for(int idx=0;idx<events.length;idx++) {
            rtfImport.addListener(events[idx]);
View Full Code Here


    * of columns
    */
   public void setWidths(float relativeWidths[]) throws DocumentException
   {
      if (relativeWidths.length != getNumberOfColumns())
         throw new DocumentException(MessageLocalization.getComposedMessage("wrong.number.of.columns"));
      this.relativeWidths = new float[relativeWidths.length];
      System.arraycopy(relativeWidths, 0, this.relativeWidths, 0, relativeWidths.length);
      absoluteWidths = new float[relativeWidths.length];
      totalHeight = 0;
      calculateWidths();
View Full Code Here

    * of columns
    */
   public void setTotalWidth(float columnWidth[]) throws DocumentException
   {
      if (columnWidth.length != getNumberOfColumns())
         throw new DocumentException(MessageLocalization.getComposedMessage("wrong.number.of.columns"));
      totalWidth = 0;
      for (int k = 0; k < columnWidth.length; ++k)
         totalWidth += columnWidth[k];
      setWidths(columnWidth);
   }
View Full Code Here

        showTextAligned(canvas, alignment, phrase, x, y, rotation, PdfWriter.RUN_DIRECTION_NO_BIDI, 0);
    }

    protected int goComposite(boolean simulate) throws DocumentException {
        if (!rectangularMode)
            throw new DocumentException(MessageLocalization.getComposedMessage("irregular.columns.are.not.supported.in.composite.mode"));
        linesWritten = 0;
        descender = 0;
        boolean firstPass = adjustFirstLine;
       
        main_loop:
View Full Code Here

     * @return the PDF as an array of bytes
     * @throws DocumentException when the document isn't ready yet
     */
    public ByteArrayOutputStream getPdf() throws DocumentException {
      if (p < 100) {
        throw new DocumentException("The document isn't finished yet!");
      }
      return baos;
    }
View Full Code Here

     * @throws IOException on error
     * @throws DocumentException on error
     */   
    public void preClose(HashMap exclusionSizes) throws IOException, DocumentException {
        if (preClosed)
            throw new DocumentException(MessageLocalization.getComposedMessage("document.already.pre.closed"));
        preClosed = true;
        AcroFields af = writer.getAcroFields();
        String name = getFieldName();
        boolean fieldExists = !(isInvisible() || isNewField());
        PdfIndirectReference refSig = writer.getPdfIndirectReference();
View Full Code Here

     * @throws IOException on error
     */   
    public void close(PdfDictionary update) throws IOException, DocumentException {
        try {
            if (!preClosed)
                throw new DocumentException(MessageLocalization.getComposedMessage("preclose.must.be.called.first"));
            ByteBuffer bf = new ByteBuffer();
            for (Iterator it = update.getKeys().iterator(); it.hasNext();) {
                PdfName key = (PdfName)it.next();
                PdfObject obj = update.get(key);
                PdfLiteral lit = (PdfLiteral)exclusionLocations.get(key);
View Full Code Here

        if (this.writer == null) {
            this.writer = writer;
            annotationsImp = new PdfAnnotationsImp(writer);
            return;
        }
        throw new DocumentException(MessageLocalization.getComposedMessage("you.can.only.add.a.writer.to.a.pdfdocument.once"));
    }
View Full Code Here

            }
            lastElementType = element.type();
            return true;
        }
        catch(Exception e) {
            throw new DocumentException(e);
        }
    }
View Full Code Here

        return pageResources;
    }

    public void addImage(LwgImage image, float a, float b, float c, float d, float e, float f, boolean inlineImage) throws DocumentException {
        if (!colorized && (!image.isMask() || !(image.getBpc() == 1 || image.getBpc() > 0xff)))
            throw new DocumentException(MessageLocalization.getComposedMessage("not.colorized.typed3.fonts.only.accept.mask.images"));
        super.addImage(image, a, b, c, d, e, f, inlineImage);
    }
View Full Code Here

TOP

Related Classes of com.lowagie.text.DocumentException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.